Skip to content

Instantly share code, notes, and snippets.

@heirloompixels
Created January 28, 2014 00:20
Show Gist options
  • Save heirloompixels/8660098 to your computer and use it in GitHub Desktop.
Save heirloompixels/8660098 to your computer and use it in GitHub Desktop.
Download moon images from NASA
require 'date'
base_uri = "http://svs.gsfc.nasa.gov/vis/a000000/a004100/a004118/frames/1920x1080_16x9_30p/plain/"
moon_num = 1
day = Date.new(2014,1,1)
while day.year == 2014 do
filename = "moon.#{"%02d" % day.mon}.#{"%02d" % day.mday}.#{day.year}.tif"
`curl #{base_uri}moon.#{"%04d" % moon_num}.tif > #{filename}`
puts "downloaded: " + filename
moon_num = moon_num + 24
day = day.next_day
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment