トップ «前の日記(2007-05-19) 最新 次の日記(2007-05-30)» 編集

活動日誌


2007-05-27

ニコニコ動画のコメント数グラフを表示する proxy

動画のある部分にだけ集中してコメントが付くことがよくあるので、 グラフにしたら面白いかと思って作ってみた。 (こういうのは GUI できれいに出すと見栄えがしてよさそうだけど)

でもこの proxy、どうやらレスポンスを全部読み込んでからじゃないと レスポンスを返さないらしく、動画をストリーミングで見れなくなってしまったので 実用性はゼロ。

#!/usr/local/bin/ruby

require 'webrick'
require 'webrick/httpproxy'
require 'uri'
require 'rexml/document'

SECTION_COUNT = 20
HIST_TOP = 30

def draw_hist(values, section_count, note)
  max_pos = values.max
  hist = Array.new(section_count, 0)
  values.map{ |e| (e.to_f / max_pos * section_count).to_i }.each{ |e| hist[e] += 1 if hist[e] }

  max_value = hist.max
  hist_dots = hist.map{ |value| (value.to_f / max_value * HIST_TOP).to_i }
  puts '-------------------------------'
  puts note
  hist.zip(hist_dots).each do |value, ndots|
    puts '%4d |%s' % [value, '*' * ndots]
  end
  puts '-------------------------------'
end

handler = Proc.new do |req, res|
  if req.host =~ /msg\d+\.nicovideo\.jp/ && req.path == '/api/' && res.content_type == 'text/xml'
    xml = REXML::Document.new(res.body)
    positions = xml.root.get_elements('chat').map{ |e| e.attribute('vpos').to_s.to_i }
    if !positions.empty?
      sec = positions.max / 100
      note = "thread: %s, max time: %d:%.2d" % [xml.root.get_elements('thread')[0].attribute('thread'), sec / 60, sec % 60]
      draw_hist(positions, SECTION_COUNT, note)
    end
  end
end

s = WEBrick::HTTPProxyServer.new(
  :BindAddress => '127.0.0.1',
  :Port => 8080,
  :Logger => WEBrick::Log::new(STDERR, WEBrick::Log::FATAL),
  :ProxyContentHandler => handler
)

Signal.trap('INT') do
  s.shutdown
end

s.start
本日のツッコミ(全100件) [ツッコミを入れる]
_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/gays-man-porn.html<br>asian gays galleries<br>asian gays galleries<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/bdsm-master-and-slave.html<br>bdsm forum<br>bdsm forum<br>news

_ TrackBack (2007-07-06 17:51)

http://adair.ok7.us/asian-shemale-links.html<br>asian shemale phone sex<br>asian shemale phone sex<br>news

_ TrackBack (2007-07-06 17:51)

http://adage.ok7.us/mature-sexy-women-in-nylons.html<br>gray pussy and black nylons<br>gray pussy and black nylons<br>news

_ TrackBack (2007-07-06 17:51)

http://adair.ok7.us/lesbian-free.html<br>really young lesbians<br>really young lesbians<br>news

_ TrackBack (2007-07-06 17:51)

http://adages.ok7.us/fotos-sexo--interracial.html<br>gallery interracial<br>gallery interracial<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/fotos-sexo-interracial.html<br>gallery of interracial sex<br>gallery of interracial sex<br>news

_ TrackBack (2007-07-06 17:51)

http://adage.ok7.us/hardcore-lesbian-muff-munchers.html<br>lesbians and hardcore kissing<br>lesbians and hardcore kissing<br>news

_ TrackBack (2007-07-06 17:51)

http://adair.ok7.us/real-father-son-gay-sex.html<br>father and son incest sex with daddy and son<br>father and son incest sex with daddy and son<br>news

_ TrackBack (2007-07-06 17:51)

http://adage.ok7.us/pussy-in-chinese-translation.html<br>transsexuals sex pics<br>transsexuals sex pics<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/hardcore-lesbian-bath.html<br>lesbian lessons hardcore<br>lesbian lessons hardcore<br>news

_ TrackBack (2007-07-06 17:51)

http://adair.ok7.us/hardcore-interracial-cheerleader.html<br>hardcore interracial movies<br>hardcore interracial movies<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/father-daughter-sex-stories-for-resding.html<br>fatty teen big tits<br>fatty teen big tits<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/my-first-lesbian-experience.html<br>masturbating lesbians<br>masturbating lesbians<br>news

_ TrackBack (2007-07-06 17:51)

http://adages.ok7.us/pay-per-view-transexual-movies.html<br>uk transexual escorts<br>uk transexual escorts<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/free-nude-women-softcore-movies.html<br>adult galleries softcore free<br>adult galleries softcore free<br>news

_ TrackBack (2007-07-06 17:51)

http://adair.ok7.us/hardcore-lesbian-footsex.html<br>hardcore lesbian ass licking<br>hardcore lesbian ass licking<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/hard-interracial-fucking-pics.html<br>hardcore interracial gallery<br>hardcore interracial gallery<br>news

_ TrackBack (2007-07-06 17:51)

http://adair.ok7.us/transexual-escorts-in-dc.html<br>thai transexual<br>thai transexual<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/piss-video-teen.html<br>toucher sex piss<br>toucher sex piss<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/lesbian-teen-hardcore-xxx.html<br>.rm hardcore lesbian<br>.rm hardcore lesbian<br>news

_ TrackBack (2007-07-06 17:51)

http://adages.ok7.us/i-wana-piss-on-you.html<br>girls who piss<br>girls who piss<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/transexual-escorts-in-mumbai.html<br>transexual shemale free porn<br>transexual shemale free porn<br>news

_ TrackBack (2007-07-06 17:51)

http://adages.ok7.us/mature-bondage-gallery.html<br>mature cum face<br>mature cum face<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/gay-softcore-video-clips.html<br>softcore porn models<br>softcore porn models<br>news

_ TrackBack (2007-07-06 17:51)

http://adage.ok7.us/jenna-jameson-softcore-lesbian.html<br>brunette teen softcore<br>brunette teen softcore<br>news

_ TrackBack (2007-07-06 17:51)

http://adage.ok7.us/cum-and-piss-drinking.html<br>drink piss girl<br>drink piss girl<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/piss-like-a-russian-race-horse.html<br>male piss sex<br>male piss sex<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/transexual-videos-demos-samples.html<br>transsexuals photo<br>transsexuals photo<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/cartoon-lesbian-porn.html<br>jetsons cartoon porn<br>jetsons cartoon porn<br>news

_ TrackBack (2007-07-06 17:51)

http://adage.ok7.us/mature-women-oral-sex.html<br>mature women with younger girls<br>mature women with younger girls<br>news

_ TrackBack (2007-07-06 17:51)

http://adages.ok7.us/www-cartoon-porn-com.html<br>cartoon rape porn<br>cartoon rape porn<br>news

_ TrackBack (2007-07-06 17:51)

http://adagios.ok7.us/free-mature-blowjob-avi.html<br>drunk amature mature women movies<br>drunk amature mature women movies<br>news

_ TrackBack (2007-07-06 17:51)

http://adagio.ok7.us/large-anal-toys.html<br>discuont adult sex toys<br>discuont adult sex toys<br>news

_ TrackBack (2007-07-06 17:52)

http://adages.ok7.us/lesbians-sex-toys.html<br>toys adult sex toy shops<br>toys adult sex toy shops<br>news

_ TrackBack (2007-07-06 17:52)

http://adagio.ok7.us/hairy-monster-gay-cocks.html<br>pictures of gay bear hairy men having gay sex<br>pictures of gay bear hairy men having gay sex<br>news

_ TrackBack (2007-07-06 17:52)

http://adages.ok7.us/hairy-gay-kissing.html<br>big gay hairy dicks pictured<br>big gay hairy dicks pictured<br>news

_ TrackBack (2007-07-06 17:52)

http://adagio.ok7.us/mature-free-galleries.html<br>young men fucking mature women<br>young men fucking mature women<br>news

_ TrackBack (2007-07-06 17:52)

http://adage.ok7.us/women-using-sex-toys-on-men.html<br>inflatable toys<br>inflatable toys<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/guys-drink-their-own-piss.html<br>pissing pee hole<br>pissing pee hole<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/softcore-porn-for-women.html<br>softcore breast photos<br>softcore breast photos<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/mature-adults.html<br>black bbw mature nude<br>black bbw mature nude<br>news

_ TrackBack (2007-07-06 17:52)

http://adagios.ok7.us/hot-cartoon-porn.html<br>free famous cartoon porn<br>free famous cartoon porn<br>news

_ TrackBack (2007-07-06 17:52)

http://adagio.ok7.us/asian-teen-video.html<br>asian teen schoolgirl<br>asian teen schoolgirl<br>news

_ TrackBack (2007-07-06 17:52)

http://adages.ok7.us/teen-asian-lesbian.html<br>asian teen ass<br>asian teen ass<br>news

_ TrackBack (2007-07-06 17:52)

http://adage.ok7.us/tgp-asian-teen.html<br>asian lesbian teen<br>asian lesbian teen<br>news

_ TrackBack (2007-07-06 17:52)

http://adagios.ok7.us/hairy-greek-gay-sex.html<br>gay hairy men in showers having sex<br>gay hairy men in showers having sex<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/free-cartoon-porn-sites.html<br>disney porn cartoon<br>disney porn cartoon<br>news

_ TrackBack (2007-07-06 17:52)

http://adagios.ok7.us/gay-men-sex-toys.html<br>strap on sex toys<br>strap on sex toys<br>news

_ TrackBack (2007-07-06 17:52)

http://adagios.ok7.us/teen-asian-girl.html<br>nude asian teen pics<br>nude asian teen pics<br>news

_ TrackBack (2007-07-06 17:52)

http://adage.ok7.us/gay-sex-men-with-black-hair.html<br>big fat hairy gay cocks<br>big fat hairy gay cocks<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/online-sex-toys.html<br>cool sex toys<br>cool sex toys<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/gay-hairy-cocksuckers-facial-cumshots.html<br>gay hairy teen sex<br>gay hairy teen sex<br>news

_ TrackBack (2007-07-06 17:52)

http://adams.ok7.us/porn-star-gauge.html<br>xxx star wars toons<br>xxx star wars toons<br>news

_ TrackBack (2007-07-06 17:52)

http://adamantly.ok7.us/d-star-wars-porn.html<br>gay porn star tom saxx<br>gay porn star tom saxx<br>news

_ TrackBack (2007-07-06 17:52)

http://adair.ok7.us/asian-hardcore-teen.html<br>free asian teen sex movies<br>free asian teen sex movies<br>news

_ TrackBack (2007-07-06 17:52)

http://adamson.ok7.us/who-wants-to-be-a-porn-star.html<br>ebony porn star gallery<br>ebony porn star gallery<br>news

_ TrackBack (2007-07-06 17:52)

http://adapt.ok7.us/lesbian-porn-star-galleries.html<br>woman group sex star<br>woman group sex star<br>news

_ TrackBack (2007-07-06 17:52)

http://adams.ok7.us/british-amateur-blowjob.html<br>amateur teen xxx blowjob<br>amateur teen xxx blowjob<br>news

_ TrackBack (2007-07-06 17:52)

http://adaptability.ok7.us/female-movie-star-pictures.html<br>porn star escort<br>porn star escort<br>news

_ TrackBack (2007-07-06 17:52)

http://adamantly.ok7.us/forced-amateur-blowjob.html<br>busty amateur blowjob<br>busty amateur blowjob<br>news

_ TrackBack (2007-07-06 17:52)

http://adamson.ok7.us/busty-amateur-blowjob.html<br>amateur cum swallowing blowjobs<br>amateur cum swallowing blowjobs<br>news

_ TrackBack (2007-07-06 17:52)

http://adapt.ok7.us/amateur-blowjob-sites.html<br>amateur home videos blowjob<br>amateur home videos blowjob<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/nude-amateur-blowjob.html<br>beautiful blowjob amateur sue<br>beautiful blowjob amateur sue<br>news

_ TrackBack (2007-07-06 17:53)

http://adams.ok7.us/her-first-anal.html<br>first anal<br>first anal<br>news

_ TrackBack (2007-07-06 17:53)

http://adamantly.ok7.us/anal-beads.html<br>anal creampie<br>anal creampie<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/anal-creampie.html<br>anal sex pregnant<br>anal sex pregnant<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/extreme-anal-insertion.html<br>free anal<br>free anal<br>news

_ TrackBack (2007-07-06 17:53)

http://adapt.ok7.us/anal-insertions.html<br>young anal<br>young anal<br>news

_ TrackBack (2007-07-06 17:53)

http://adams.ok7.us/asian-babes-sucking-tits.html<br>free nude pics of asians with big tits<br>free nude pics of asians with big tits<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/asian-big-tits-fucked-in-public.html<br>big tits asian kiku<br>big tits asian kiku<br>news

_ TrackBack (2007-07-06 17:53)

http://adamantly.ok7.us/hot-asians-big-tits.html<br>asian big tits round asses<br>asian big tits round asses<br>news

_ TrackBack (2007-07-06 17:53)

http://adapt.ok7.us/big-asian-tits-fucking.html<br>big huge asian tits<br>big huge asian tits<br>news

_ TrackBack (2007-07-06 17:53)

http://adams.ok7.us/nurse-uniforms.html<br>cartoon girls in uniforms<br>cartoon girls in uniforms<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/uniform-sluts-zone.html<br>kinky uniform sex<br>kinky uniform sex<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/asian-big-tits-round-asses.html<br>asian street hookers with big tits<br>asian street hookers with big tits<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/uniform-commercial-code.html<br>soccer uniforms<br>soccer uniforms<br>news

_ TrackBack (2007-07-06 17:53)

http://adapt.ok7.us/hardcore-uniform-sex.html<br>gay uniform sex galleries<br>gay uniform sex galleries<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/ebony-cock-in-pussy.html<br>licking pussy mpegs ebony<br>licking pussy mpegs ebony<br>news

_ TrackBack (2007-07-06 17:53)

http://adams.ok7.us/ebony-lesbians-eat-white-pussy.html<br>ebony pussy gallery free<br>ebony pussy gallery free<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/ebony-pussy-video.html<br>free pussy ebony<br>free pussy ebony<br>news

_ TrackBack (2007-07-06 17:53)

http://adapt.ok7.us/skinny-ebony-pussy.html<br>ebony pussy print<br>ebony pussy print<br>news

_ TrackBack (2007-07-06 17:53)

http://adams.ok7.us/gays-sex-black.html<br>blacks gays<br>blacks gays<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/fotos-e-gays-e-papai.html<br>fotos de sexo gays<br>fotos de sexo gays<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/hot-nude-gays.html<br>ass fucking gays<br>ass fucking gays<br>news

_ TrackBack (2007-07-06 17:53)

http://adamantly.ok7.us/latina-cop-uniform-panties.html<br>football uniform<br>football uniform<br>news

_ TrackBack (2007-07-06 17:53)

http://adaptability.ok7.us/gay-son-bdsm.html<br>i want to see gay bdsm spanking butt fucking<br>i want to see gay bdsm spanking butt fucking<br>news

_ TrackBack (2007-07-06 17:53)

http://adams.ok7.us/adult-image-galleries-fetishes-bdsm.html<br>male bdsm andnot women girl femdom rape lesbian<br>male bdsm andnot women girl femdom rape lesbian<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/extreme-movie-bdsm.html<br>bdsm dating<br>bdsm dating<br>news

_ TrackBack (2007-07-06 17:53)

http://adamson.ok7.us/asian-shemale-pic.html<br>asian shemale sluts<br>asian shemale sluts<br>news

_ TrackBack (2007-07-06 17:54)

http://adaptability.ok7.us/asian-shemale-video.html<br>asian shemales free galleries<br>asian shemales free galleries<br>news

_ TrackBack (2007-07-08 09:47)

http://banglive.info/directsexcam/bdsm.html<br>bdsm anime<br>bdsm anime<br>news

_ TrackBack (2007-07-08 09:47)

http://superpopka.info/lovedollsextoy/interracial.html<br>interracial sex free<br>interracial sex free<br>news

_ TrackBack (2007-07-08 09:47)

http://banglive.info/bostonsexclub/lesbians.html<br>lesbians sex having<br>lesbians sex having<br>news

_ TrackBack (2007-07-08 09:47)

http://banglive.info/amateuralluresex/fat.html<br>sister father sex<br>sister father sex<br>news

_ TrackBack (2007-07-08 09:47)

http://banglive.info/bostonsexclub/interracial.html<br>interracial sex mpegs<br>interracial sex mpegs<br>news

_ TrackBack (2007-07-08 09:47)

http://banglive.info/directsexcam/nylon.html<br><br><br>news

_ TrackBack (2007-07-08 09:48)

http://superpopka.info/freesexstorypic/interracial.html<br>sex interracial<br>sex interracial<br>news

_ TrackBack (2007-07-08 09:48)

http://banglive.info/japansextour/nylon.html<br><br><br>news

_ TrackBack (2007-07-08 09:48)

http://banglive.info/amateuralluresex/hardcore.html<br>free adult hardcore porn<br>free adult hardcore porn<br>news


2005|02|03|04|05|06|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|03|04|05|06|10|
2008|04|10|
2009|10|
2010|05|08|
2012|01|02|03|
2014|01|
トップ «前の日記(2007-05-19) 最新 次の日記(2007-05-30)»