I’ve been busy implementing a new website for my weather station over the last few weeks at Wayne’s Weather.
There are a number of new technologies being employed. I’ve ditched my bespoke (and ugly) HTML and instead use Bootstrap for a client responsive UI. Chart and image viewing is now more user-friendly thanks to Lightbox. I have also made extensive use of JQuery to pull in information from various sources and to provide a more dynamic experience.
The functionality of the site has also been extended. There are now more in-depth current readings supporting both metric and imperial measurements, forecasts and weather maps from Wunderground.com for the local area have been integrated and I have added a weather webcam and a weather almanac. I intend to write posts to cover the wunderground and webcam build outs soon.
For now this post will concentrate on an unexpected off-shoot of my efforts: a Web Service that exposes Weather Display Live data.
Weather Display Live
Weather Display (and its equivalents such as MeteoHub) can generate clientraw.txt files containing a weather station’s readings and can upload them to a web server periodically and frequently via FTP (in some cases every minute). The primary purpose of this is to drive a Weather Display Live (WDL) dashboard:

Click to Enlarge
The WDL clientraw.txt format is well documented and I have previously used the HTTP addressable clientraw.txt to drive a custom Android widget and my PiFaceCAD Weather Display Console. The disappointing aspect is WDL itself. Don’t get me wrong it’s an excellent weather dashboard and I still have it available in my new website. The problem with it is that is Flash based which is not as widely supported as it used to be. It’s pretty much not an option for mobile device clients running IOS or Android, for example.
To counter this I wanted my new website to make far greater use of the information contained in the clientraw.txt files outside of WDL dashboard itself. My old weather website made use of PHP to grab weather readings from clientraw.txt and place them into web pages before serving them up to the client. This was an approach I wanted to move away from.
I’d just cut my teeth on using JSON formatted web services with my experience as a client to the Wunderground API. I liked the idea of having a page load its own data from the client side where it could conceivably be mix and match data from various services. I figured it wouldn’t be too difficult to create my own web services to expose WDL data and call them from my own web site.
json-webservice-wdlive
I settled on using PHP for the implementation for a couple of reasons. Firstly because I’ve used it for server-side processing on-and-off for a few years and know if fairly well. Secondly because I intended to write a general solution which I could open source for others to use and PHP is ubiquitous in the hosting world.
The result was json-webservice-wdlive, a JSON formatted web service API.
The API exposes two URLs. The first URL returns current weather conditions including Temperature, Pressure, Rainfall, Wind, Humidity, Dew Point, Wind Chill, Humidex, Heat Index and UV. The second URL returns a weather almanac for Month-to-Date, Year-to-Date and All Time records. Both JSON and JSONP (enabled with the addition of a callback attribute to the URL) are supported.
Besides exposing the data in the default units found in clientraw the responses also contain many alternative units. For example, clientraw files store wind speeds in knots. The Web Service responses, on the other hand, respond with Bft, knots, km/h, mph, and m/s.

Click to Enlarge
Note that I only expose the data I need for my own purposes (i.e. what my weather station setup supports). However, it would be a simply matter to expand the service calls to add, say, solar measurements or extend the selection of almanac measurements. Anything else WDL clientraw.txt files provide can be exposed, if required, with minor code additions.
I have made the json-webservice-wdlive source code available as a GitHub project. Have a look in the project’s README for installation instructions. json-webservice-wdlive is also running live on my own weather website. You can try it at by clicking on the links below:
Refer to the GitHub project page for more details on the Web Service’s response fields including the different measurement units and number field formatting details.
I also make use of the service in three places on my own website: the Current Conditions, Weather Almanac (pictured below) and the Forecast page where I mix my service’s results with those from the Wunderground web service.

Click to Enlarge
If you have a WDL enabled website feel free to install json-webservice-wdlive to expose your weather data to others and/or to include your information in your own pages.