Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#! /usr/bin/env ruby
# Scrape the user list of to make a list of those
# who have posted at least LIMIT items, for use by the feed filter mentioned in
require "rubygems"
require "nokogiri"
require "open-uri"
LIMIT = 15
page = 1
count = nil
url = "{page}.html?order=desc&sort=posts&pp=#{PERPAGE}"
$stderr.puts url
doc = Nokogiri::HTML(open url)
doc.css("a.username").each do |u|
count_n = u.at_xpath('../../td[@class="alt1 postcount"]')
count ="^0-9", "").to_i
break if count <= LIMIT
$stderr.printf "%5d ", count
puts u.content
page += 1
end until count <= LIMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.