web

外部からみえないサーバー上にあるwebページを外から見えるようにする

sshポート転送を利用するGWサーバ(CGI起動できる) サーバ1[ch](GWサーバーからみえる、サーバー2からみえる GWとサーバー1をつなぐ踏み台 兼 サーバー1のポートとLWBのポートが結ばれている) サーバ2[in](サーバ1からみえ、LWBもみえる サーバー1とLWB…

ruby のmechanizeで特定時間でアクセスをやめる方法: Timeoutの設定

http://www.pistolfly.jp/weblog/2011/06/open-uritimeout.html Time out時間を1秒に設定。 1秒たって接続できなければあきらめる。 require "rubygems" require "mechanize" require "hpricot" require "kconv" require "uri" #require "timeout" require…

yahoo検索で検索の件数を表示するスクリプト

yahoo検索で検索数を表示するスクリプト 検索word: "test" require "rubygems" require "mechanize" require "hpricot" require "kconv" require "uri" $KCODE="u" #tmp123="http://www.aeon.info/" #text="link:"+tmp123; text="test" search=URI.encode(te…

他の人のフォロワーの出力改良版

他の人のフォロワーの出力改良版 http://d.hatena.ne.jp/arupaka-_-arupaka/20091011の改良:とりあえず、ページ数にむりやり5を足している問題は解決させた。 ただし、 APIのエラー (http://d.hatena.ne.jp/kermitonphd/20091011を参照) 取得中にフォロ…

他の人のフォロワーの取得

他の人のフォロワーの名前の取得例 オバマただし、APIの制限で100人までしか 取得できない。 require 'rubygems' require 'twitter' oauth=Twitter::HTTPAuth.new('Email','pass') agent = Twitter::Base.new(oauth) agent.followers(:screen_name => 'Barac…

フォロワーを全員表示

フォロワーを全員表示。暫定版、 あんまりいい方法ではない。 オバマとかは多すぎてたぶん無理です。 require 'rubygems' require 'twitter' oauth=Twitter::HTTPAuth.new('EMAIL','PASSWORD') agent = Twitter::Base.new(oauth) count=agent.user(-1,{'scre…

 今日の記録

5476

twitter オバマのフォロワー数を表示。

twitter オバマのフォロワー数を表示。 require 'rubygems' require 'twitter' oauth=Twitter::HTTPAuth.new('Email','Password') agent = Twitter::Base.new(oauth) puts agent.user(-1,{'screen_name'=>'BarackObama'})['followers_count'] とすればよい。…

pythonでyahooを検索

web

pythonでとりあえずyahooを検索 単語 'test'を検索 import urllib2for line in urllib2.urlopen('http://search.yahoo.co.jp/search?p=test') print line; 参考: http://docs.python.org/tutorial/stdlib.html#mathematicspython tutorial http://docs.pyth…

[web] ストリーミング配信のしくみ

web

ストリーミング配信のしくみ音声や映像をすべてダウンロードしなくても、再生できる。メタファイル(たとえば、asx拡張子で示される)にストリーミングされる音声や映像 ファイル(mp3やwmvなどの拡張子)などのリンクを 記述する。ストリーミングされる音声等…