Skip to content

Instantly share code, notes, and snippets.

@danielmiessler
Created January 16, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmiessler/cd4043386e2d73847194 to your computer and use it in GitHub Desktop.
Save danielmiessler/cd4043386e2d73847194 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# Change for your ZIP
page = Nokogiri::HTML(open("http://www.airnow.gov/?action=airnow.local_city&zipcode=94102&submit=Go"))
# Get the current air quality
puts page.css('table.AQData td.AQDataLg').text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment