IT戦記 このページをアンテナに追加 RSSフィード Twitter

2009-04-30

ニコニコ動画がもうすぐ 100 億再生!

このペースでいくと

ゴールデンウィーク中に突破するかな。

ニコニコ動画総再生数(百万単位)

何かアニバーサリー的なのはないのかな、かな、かな?

bashperl で、 1 分置きにニコニコ動画の再生数を表示するワンライナー

while :; do perl -MLWP::Simple -MHTML::TreeBuilder::XPath -le "print HTML::TreeBuilder::XPath->new_from_content(get shift)->findnodes(shift)->[0]->content->[0]" http://nicovideo.jp/ "id('PAGEFOOTER')//strong[2]" && sleep 60 ; done
clear と jabanner などを組み合わせると、いい感じです。

f:id:amachang:20090430204139p:image

while :; do clear && perl -MLWP::Simple -MHTML::TreeBuilder::XPath -le "print HTML::TreeBuilder::XPath->new_from_content(get shift)->findnodes(shift)->[0]->content->[0]" http://nicovideo.jp/ "id('PAGEFOOTER')//strong[2]" | jabanner -a && sleep 60 ; done

DOS プロンプトと perl で、 1 分置きにニコニコ動画の再生数を表示するワンライナー

for /L %i in (0,0,1) do perl -MLWP::Simple -MHTML::TreeBuilder::XPath -le "print HTML::TreeBuilder::XPath->new_from_content(get shift)->findnodes(shift)->[0]->content->[0]" http://nicovideo.jp/ "id('PAGEFOOTER')//strong[2]" && timeout 60

from_kyushufrom_kyushu 2009/04/30 21:56 Rubyオンリーで同様のことをやってみました。要Rubygems & WWW::Mechanizeです。

ruby -rubygems -e "require 'mechanize'; loop{ puts WWW::Mechanize.new.get('http://www.nicovideo.jp/').search('//div/strong[2]').inner_text; sleep 60}"

Win,Mac両方で動く事を確認しました。

amachangamachang 2009/05/07 13:07 おお。すばらしいです。
WWW::Mechanize 便利ですね。

はてなユーザーのみコメントできます。はてなへログインもしくは新規登録をおこなってください。