Last active
August 29, 2015 14:02
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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