Skip to content

Instantly share code, notes, and snippets.

@bensbigolbeard
bensbigolbeard / Ffffound_pages function
Created January 14, 2014 18:36
Nokogiri-Ffffound-scraper
require 'open-uri'
require 'nokogiri'
require 'mechanize'
def ffffound_pages(number)
pg_counter = 0
while pg_counter < 25*number
# grab console args
arg = ARGV[0].to_i
# instantiate counters
outer_counter=0; inner_counter = 0; overall_counter = 1
# instantiate row string
row_str = ""
while outer_counter < arg
while inner_counter <= outer_counter
row_str << overall_counter.to_s + " "
def convert(digit)
result = ""
remainder = digit
while remainder > 0
case remainder
when remainder <= 1000
result << "M"
remainder = remainder - 1000
when 900..999