Skip to content

Instantly share code, notes, and snippets.

@pry0cc
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save pry0cc/ccaa3ac55747f8d8dfc1 to your computer and use it in GitHub Desktop.

Select an option

Save pry0cc/ccaa3ac55747f8d8dfc1 to your computer and use it in GitHub Desktop.
A script to get links to all the images on Facets.la by Justin Maller. You can use it with wget to download them all if you so desire.
#!/usr/bin/ruby
require 'uri'
require 'open-uri'
image_no = 365; year = 2014; filename = 1
image_no.times{
year = 2013 if image_no < 332
source = open("http://www.facets.la/#{year}/#{image_no}/wallpaper/").read
url_index = URI.extract(source).select{ |l| l[/\.(?:jpe?g)\b/] }
image_no += -1
url_index.each { |image_url| $url = image_url }
puts $url
system("wget -N #{$url}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment