Skip to content

Bulk Upload of Historical Weather Data to Wundergound

A few months ago I bought a weather station but only lately registered with Wunderground and was slightly dismayed that the software I use (Cumulus, which is heaps better than what the station supplier included) does not post historical data; it only uploads to Wunderground what it downloads from the station when Cumulus starts up.

It seems there is no “off the shelf” way of doing this so here is a how-to-do it. The steps should be applicable to any weather station software that stores the data as a “CSV” or formatted text file, with a little bit of fiddling. I guess a similar process works for weather upload sites other than Wunderground too. The steps are:

  • get the stored data into a spreadsheet. This is easy for Cumulus since the data is stored in a text file with commas separating the values and the Cumulus help file tells you what each column is.
  • convert the units. I prefer SI units but Wunderground uses American conventions.
  • create a URL (web address), one for each data record to be uploaded. The structure for these is documented on the wunderground wiki. You can simply copy these into a web browser (Firefox, Internet Explorer etc) one by one but once you’ve had the satisfaction of seeing it work, the remaining thousands of records need a better method.
  • use wget to process a batch of URLs. Wget is free open source software. Windows users can find in installer here.

I’ve uploaded an example spreadsheet that does the conversion and creates the URLs. Notice it has three sheets and that the “Conversion Factors” also contains the base of the URL. This must be edited to have your station name and password. NB there is also a Celcius-Farenheit conversion and the peculiar column L on the “Converted” sheet is needed to get a correctly formatted URL from the date-time combination.

To use wget I copied the URLs into a “.txt” file, one URL per line (just drag down the entries in the column of the spreadsheet and copy/paste into an empty text file) and created a small “.bat” file containing:

PATH “C:\Program Files\GnuWin32\bin”
wget -v -o log.txt -O responses.txt -i “urls Apr12.txt”

You may need to alter the first line depending on where you installed wget. The second line assumes the list of URLs was saved to “urls Apr12.txt”. The “log.txt” file contains verbose logging of each “wget” and the “responses.txt” file should just contain a long string composed of one “sucess” for each sucessful posting of data. If it doesn’t, something went wrong…

4 Comments