Kingston Weather – Twitter feed

Some time ago, I set up a Twitter account to relay the local weather report to my cellphone. The plan was to use TwitterFeed to relay the RSS from The Weather Network to the Twitter account, then follow it via SMS.

Lots of sabots in the works. First and foremost the RSS from The Weather Network is no good (incorrect/invalid/inconsistent date formats, some other brokenness). Twitterfeed offers two ways to detect a new posting – the GUID, or the pubDate. As mentioned, the pubDates used in the feed are just plain wrong, so no help there. The GUID for each post, also not helpful – it’s the static link to the current weather page; long-term forecast is indicated by ref=day1, ref=day2, etc in the URL – so that doesn’t change, even when the content does.

I have meant for a long time to fix it (before today, the last post form Twitterfeed was July 18), but aside from a few quick hacks, never completed it. Lately, the explosion in Kingstonians using Twitter has inspired me to fix it, especially the new followers @KingstonWeather has gained.

After some trial-and-error, I ended up building a php script to write an entirely new RSS feed, based on the one provided by The Weather Network – this one is valid, has proper (unique) IDs for the posts, and appears to work in Twitterfeed.