Created
January 8, 2011 01:08
-
-
Save venj/770401 to your computer and use it in GitHub Desktop.
Download pics.
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
#! /usr/bin/env ruby | |
# Usage: | |
# 1. install ruby and wget if you don't have | |
# 2. gem install nokogiri | |
# 3. mkdir pics, put this script into it | |
# 4. ruby batch_down_pics.rb | |
# (or chmod +x batch_down_pics.rb && ./batch_down_pics.rb) | |
# | |
# WARN: 18+ content! | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
base_url = 'http://empressofkink.tumblr.com/page/' | |
(1..111).each do |page| | |
full_url = base_url + page.to_s | |
doc = Nokogiri::HTML(open(full_url)) | |
doc.xpath('//div/a/img').each do |img| | |
system("wget #{img['src']}") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment