Skip to content

Instantly share code, notes, and snippets.

@sorah
Created August 20, 2009 12:54
Show Gist options
  • Save sorah/171049 to your computer and use it in GitHub Desktop.
Save sorah/171049 to your computer and use it in GitHub Desktop.
#-*- coding: utf-8 -*-
require "rubygems"
require "mechanize"
require "kconv"
def get_members()
agent = WWW::Mechanize.new
ary = []
page = agent.get("http://generation1991.g.hatena.ne.jp/diarylist")
while page.at(".next")
page.search(".refererlist/ul/li/a").each{|m| ary << m["href"].gsub("/","")}
page = agent.get(page.at(".next")["href"])
end
return ary
end
p get_members()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment