WordPress CWOP Widget
There are multiple weather widgets and plugins for WordPress which draw generic data from standard sources (eg: accuweather.com, weather.com) as well as the WX Weather Widget that will pull from specific personal weather stations registered with WunderGround. But there didn’t seem to be any which will pull personal weather station data from the Citizen Weather Observer Program. This CWOP widget aims to fill that void. It also aims (initially?) to be simple, so rather than trying to pull any data from anywhere it is focused specifically on pulling single weather station data from CWOP.
The basic widget infrastructure is standard WordPress php. The actual data collection/visualization is also php but with AJAX. It is licensed under the GPLv2 (see COPYING file)…please contact me (Tim Pepper) with suggestions, bugs and whatnot.
It’s questionable whether it really makes sense to make this AJAX given that CWOP data samples are coming in at a frequency on the order of once every 5minutes (or less). This is partly just a personal proof of concept as I know people don’t look at pages on my blog that long. But depending on how I extend the plugin it might eventually pull data from other sources that have higher sample rates. Ultimately the AJAX would make it easier to have a live view of the weather station’s data.
Installation/Use:
Install as you would any WordPress plugin, ie: place the files in a subdirectory (eg: wp_cwop) of your WordPress wp-content/plugins directory. In the admin UI’s “Plugins” area, activate the CWOP Widget for Wordpress. You will now have a “CWOP” widget available under the Widgets section of the admin UI’s “Appearance” section. Simply drag and drop CWOP widgets into your sidebars. Select the widget and edit the station id and sidebar section header text fields. Save the updated settings. The widget should now be showing data in your sidebar!
Downloads:
- Current stable release: wp_cwop-0.50.tar.gz (md5sum: db4d716ef50449a9a26d68f31961a17d)
- Development release: I’m hacking away periodically in the wp_cwop git repo. Whatever is committed should always be functional…if ugly
Milestones and Development:
This is an open source project, though it is just starting out and I’m the sole developer (and most likely user) at this point. Patches are very welcome (unified diff format please, eg: diff -Naurbp). Simply email me…
- apparently the ajax stuff is broken in IE browser…need to investigate
- basic plugin/widget with text-only CWOP weather data displayed automatically refreshing via AJAX: DONE
- user config options:
- cwop station identifier: DONE
- data selection: temp, wind dir, wind speed, wind gust, rain hour, rain day, humidity, barometer
- web page: url for detailed info from the station
- advanced options:
- units (imperial/metric/nautical)
- default time window: fancy gui would allow it to be changed at runtime, but start with current data or 24hrs data (plus maybe 3days, 1week, or others)
- gui vs. txt
- GUI display: I need to do some learning here
- What technology: GWT? WP uses SACK and/or JQuery…Do these actually have GUI library stuff or do completely build your own always (hard to believe that’d be the case)? I could do something quick an dirty generating google charts urls for an img tag
- How to control the image size is sane with respect to WordPress’ sidebar size…don’t want a large set of gui elements overflowing a small sidebar…(eg: if I can see the sidebar is small automatically do a more minimal data display?). Presumably this is visibile somewhere in a friendly way (and not just be trolling through the CSS that was served with the page in which the widget is displaying).
- “fancy” stuff like user changes the display’s time window, appropriate data fetched and displayed. This seems like it will require learning JSON and moving the data in bulk to the client.
- click (DONE, for text display) or scroll wheel w/ mouse focus or PageUp/Down or ArrowUp/Down to cycle between data types

[...] project lives here, is open source, and hopefully will continue to get some periodic tweeking over the coming weeks to [...]