ふぁぼられグラフふぁぼられ集計 を改良して、
アイコンを並べたグラフっぽいHTMLに書き出すようにしてみました。
----
require 'rubygems'
require 'hpricot'
require 'net/http'
Net::HTTP.version_1_2
# const
Address = 'favotter.matope.com'
Path1 = '/user.php?user='
Path2 = '&mode=new&page='
TwitterAddress = 'http://twitter.com/'
if ARGV.length == 0 then
printf("usage: ruby favogra.rb account [max_page]\n")
exit
end
if ARGV.length < 2 then
max_page = 20
else
max_page = ARGV[1].to_i
end
counter = {}
counter.default=0
img_src = {}
# parse
path = Path1+ARGV[0]+Path2
i = 1
skip_flag = false
while i<max_page
path = Path1+ARGV[0]+Path2+i.to_s
Net::HTTP.start(Address){|http|
response = http.request_get(path)
body = response.body
doc = Hpricot(body)
doc.search("div[@class~='info']").each{|div|
(1/3) 次»
コメント(0)|コメントを書く
カテゴリー一覧
最近のコメント
このブログを友達に教える