Introducing the myweatherfeed gem

require 'myweatherfeed'

feed = MyWeatherFeed.new '/tmp/weather', location: 'Lochend, Edinburgh', \
                             api_key: '465xxxxxxxxxxxxxxxxxxx6ea01cbff4', \
                                 url_base: 'http://www.jamesrobertson.eu/',\
                       dx_xslt: '/xsl/dynarex-b.xsl', rss_xslt: '/xsl/feed.xsl'
feed.update


The above code fetches the weather forecast from forecast.io and then updates the RSS feed at http://www.jamesrobertson.eu/weather/rss.xml, and the RSS file is created if doesn't already exist. The filepath would normally point to the webserver directory, however I set it to /tmp for testing purposes.

Resources