Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbodhi/8424252 to your computer and use it in GitHub Desktop.
Save chrisbodhi/8424252 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
require 'mechanize'
def ffffound_pages(number)
pg_counter = 0
while pg_counter < 25*number
counter = 1
page = Nokogiri.HTML(open("http://ffffound.com/home/jberlow/found/?offset=#{pg_counter}&"))
blockquotes = page.css("blockquote")
while counter =< 25
picture_url = blockquotes[counter].css("img").attr("src")
agent = Mechanize.new
agent.get(picture_url).save
counter += 1
end
pg_counter +=25
end
end
ffffound_pages(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment