Skip to content

Instantly share code, notes, and snippets.

@MelanieS
Created December 1, 2011 08:24
Show Gist options
  • Save MelanieS/1414964 to your computer and use it in GitHub Desktop.
Save MelanieS/1414964 to your computer and use it in GitHub Desktop.
Script finds hubbers that have a authorscore of five and under (hubpages.com)
require 'nokogiri'
require 'open-uri'
=begin __
/ _)
_.----._/ /
/ /
__/ ( | ( |
/__.-'|_|--|_|
http://hubpages.com/forum/topic/87923
=end
def get_hubbers(url)
naughty_hubbers = []
page = open(url)
Nokogiri::HTML(page).css('div.author_pic').each do |e|
author_score = e.at_css("span").text.to_i
profile_url = e.at_css("a")['href']
if author_score <= 5
naughty_hubbers << profile_url
end
end
naughty_hubbers
end
puts "Enter last page url"
url = gets
list = get_hubbers(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment