Skip to content

Instantly share code, notes, and snippets.

@bensbigolbeard
Created January 14, 2014 18:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bensbigolbeard/8423307 to your computer and use it in GitHub Desktop.
Save bensbigolbeard/8423307 to your computer and use it in GitHub Desktop.
Nokogiri-Ffffound-scraper
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)
@a17levine
Copy link

❤️ ❤️ ❤️ ❤️ ❤️ ❤️ !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment