Created
August 20, 2009 12:54
-
-
Save sorah/171049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- 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