Skip to content

Instantly share code, notes, and snippets.

@whilefalse
Created May 9, 2012 12:59
Show Gist options
  • Save whilefalse/2644329 to your computer and use it in GitHub Desktop.
Save whilefalse/2644329 to your computer and use it in GitHub Desktop.
Apod Image Grabber
%w{nokogiri open-uri fileutils date}.each(&method(:require))
base = 'http://apod.nasa.gov/apod/'
FileUtils.mv(open(base + Nokogiri::HTML(open(base)).css('img')[0].attributes['src'].value), "apod-#{Date.today.strftime('%Y-%m-%d')}.jpg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment