Created
May 11, 2012 18:15
-
-
Save coderforhire/2661465 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| desc "Fetch weather" | |
| task :fetch_weather => :environment do | |
| require 'nokogiri' | |
| require 'open-uri' | |
| @weathers = Weather.all | |
| @weathers.each do |weather| | |
| url = "URL.com/1w.xml?location=#{weather.zip}" | |
| puts url | |
| doc = Nokogiri::HTML(open(url)) | |
| #weather.update_attribute(:humidity, humidity) | |
| puts doc | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment