Wednesday, October 27, 2010

Auto processing and upload of sat images on Emilys blog site

Unusually I found myself finishing my normal admin tasks an hour or so early, so Ive had a few spare mins to automate processing and upload of the sat images to Emilys blog site -  http://myweatherblog.wordpress.com/ 

To avoid filling the blog with images Ive limited uploads to just those from NOAA15, which typically gives as about 3 good passes a day.

To make life easy Ive used a command-line php script to re-size the images down to 380pix width (about right for the site layout). It also extracts the image data automatically from the filename - ie the satellite name (in case I change it) AOS time in UTC and the type of image processing used. It then pushes the image to wordpress as a media upload and then builds a page dynamically around it and the extracted data. This is done using a standard XML-RPC call.  (The script is called from the crontab at 15 min intervals throughout the day.)


Yes its much easier to just live update data on one of my servers - but this also serves as a proof-of-concept project demonstrating that it is possible to use some simple scripting even on a local desktop to push dynamic data onto what would be normally considered a static blog site.


If there is sufficient interest I will upload a few code examples.

No comments:

Post a Comment