Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Show 4chan your GitHub Projects

Name: Anonymous 2012-03-04 21:19

4chanImageGroper is a image crawler that grabs all the images in a thread and saves them on your computer.
It's written in Ruby.

https://github.com/serv/4chanImageGroper

--

Show off yours and let's watch interesting ones.

Name: Anonymous 2012-03-05 1:34

>>15-16
OP clearly has no idea how regexes work. A pattern like /[http]{4}/ will match the strings hhhh and ptth in addition to the intended http. Furthermore he doesn't seem to understand that a dot (.) will match any character that could possibly show up in a URL, not just punctuation.

A sane version would look something like this:
def whichBoard(html_content, url)
  %w(a b c d e f g gif h hr co ic k).each do |boardname|
    host = 'http://images.4chan.org/'
    if url["#{boardname}"]
      regex = %r[#{host}#{boardname}/src/[0-9]{13}\.(jpe?g|png|gif)]
      return html_content.scan(regex)
    end
  end
end # end end end end end end


OP, please learn to use your tools.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List