|  現在地 HOME > テスト9 > 214.html
 ★阿修羅♪ |  | 
(回答先: Re: テスト 投稿者 クエスチョン 日時 2005 年 2 月 23 日 20:13:39)
 
Firefoxの普及状況は?【高木浩光@自宅の日記】
http://takagi-hiromitsu.jp/diary/20041225.html#f01
Firefoxはどのくらい普及しているのだろうかと、この日記のアクセスログから、訪問者が使用していたブラウザの種類を調べてみた。
図1のグラフは、/diary/ および /diary/*.html への GETアクセスについて、日別に、ブラウザの種類を棒グラフ(目盛は左)に、アクセス数を折れ線グラフ(目盛は右)に示している。「others」にはランク外のブラウザの他に検索ロボットなども含まれている
画像
http://takagi-hiromitsu.jp/diary/fig/20041225/1.png
集計に使用したプログラムは以下の通り*1。
#! /usr/local/bin/ruby
logformat = /^(\S*) (\S*) (\S*) \[(...........):(........) .....\] "(\S*) (\S*)
(\S*)" (\S*) (\S*) "([^"]*)" "([^"]*)"/
total = 0
msie = firefox = mozilla = netscape6 = opera = safari = w3m = netscape4 = antenn
a = others = 0
while line = gets()
    line.chomp!()
    (addr, user, auth, date, time, method, path, protocol, status, length, refer
rer, agent) = line.scan(logformat)[0]
    next if method != "GET"
    next if not path.match(/^\/diary\/$|^\/diary\/.*\.html$/)
    total += 1
    if agent.match(/Opera/)
        opera += 1
    elsif agent.match(/Firefox/)
        firefox += 1
    elsif agent.match(/Safari/)
        safari += 1
    elsif agent.match(/w3m/)
        w3m += 1
    elsif agent.match(/MSIE/)
        msie += 1
    elsif agent.match(/Netscape\/[67]/)
        netscape6 += 1
    elsif agent.match(/Mozilla\/4\.[6789]/)
        netscape4 += 1
    elsif agent.match(/Gecko\//)
        mozilla += 1
    elsif agent.downcase.match(/antenna|wdb|rss|samidare|livedoorcheckers|glucos
e|blogpeople/)
        antenna += 1
    else
        others += 1
    end
end
print "#{total} #{msie} #{firefox} #{mozilla} #{netscape6} #{opera} #{safari} #{
w3m} #{netscape4} #{antenna} #{others}\n"
*1 ご利用はご自由に。
 
 題名には必ず「阿修羅さんへ」と記述してください。
 題名には必ず「阿修羅さんへ」と記述してください。