lib/breathe_in/scraper.rb in breathe_in-0.3.0 vs lib/breathe_in/scraper.rb in breathe_in-0.4.0
- old
+ new
@@ -11,10 +11,10 @@
@@scraped
end
def self.scraped_page(zipcode)
begin
- @@scraped = Nokogiri::HTML(open("http://airnow.gov/?action=airnow.local_city&zipcode=#{zipcode}&submit=Go"))
+ @@scraped = Nokogiri::HTML(open("http://airnow.gov/?action=airnow.local_city&zipcode=92505&submit=Go", :allow_redirections => :all))
rescue OpenURI::HTTPError => e
if e.message == '404 Not Found'
puts "The website is currently down. Pleaes try again later."
else
raise e
\ No newline at end of file