Created
January 14, 2014 18:36
-
-
Save bensbigolbeard/8423307 to your computer and use it in GitHub Desktop.
Nokogiri-Ffffound-scraper
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 '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
❤️ ❤️ ❤️ ❤️ ❤️ ❤️ !!!