Created
June 25, 2011 02:16
-
-
Save BlakeWilliams/1046029 to your computer and use it in GitHub Desktop.
XKCD Downloader
This file contains 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
require 'httparty' | |
1.upto(916) {|x| File.open('./xkcd2/'+x.to_s+'.jpg','w') {|f| f.write(HTTParty.get('http://imgs.xkcd.com/comics/' + HTTParty.get('http://xkcd.com/'+x.to_s).body.match(/(?<=src\="http:\/\/imgs\.xkcd\.com\/comics\/).*?(?=")/).to_s))}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment