Skip to content

Instantly share code, notes, and snippets.

@tobynet
Forked from ssig33/hatena_to_delicious.rb
Created September 27, 2011 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobynet/1245173 to your computer and use it in GitHub Desktop.
Save tobynet/1245173 to your computer and use it in GitHub Desktop.
require "mechanize"
alice = Mechanize.new
(0..20).each{|q|
t = q*50 + 1
page = alice.get "http://tophatenar.com/ranking/subscriber/#{t}?blog=hatena"
page.root.xpath("//td[@class='odd']/a").map{|x| x["href"].split("/").last}.uniq.each{|d|
begin
page = alice.get "http://delicious.com/register"
form = page.forms[1]
form.username = d
form.password = "kogaidan"
form.email = "#{d}@ssig33.com"
page = alice.submit form
rescue
end
puts d
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment