Tweet Search Stream Twitter Streaming APIを使ったリアルタイムTwitter検索です。 新しいTweetが投稿されると、数秒で反映されます。 実験的なサービスであり、予告なく停止する場合があります。
2012年11月1日追記 Twitter APIの仕様変更により、本記事内のソースコードは多分正しく動作しません。 ソースコードを見たい場合は、以下の記事及びリポジトリをご覧ください。 Twitter UserStreamから高速ダジャレ返信するbotのソースコードを公開しました - でぶぬる日記 https://github.com/aquarla/twitter_dajare_bot 以下、本記事の内容 http://dev.twitter.com/pages/user_streams に書いてある通り、Twitter の User Stream API が正式版として公開されているようなので、タイムラインを表示するサンプルプログラムを作ってみました。 参考にさせて頂いたのは以下のサイトです。 Twitter Streaming APIをRubyで試してみる - しばそんノート 但し、
ぜろむきゅー wget http://www.zeromq.org/local--files/area:download/zeromq-2.0.7.tar.gz tar -zxvf zeromq-2.0.7.tar.gz cd zeromq-2.0.7 ./configure make sudo make installソースから入れてるのはC++ binding目当て それからgem入れる sudo gem install zmqhttp://gist.github.com/498513 とか http://gist.github.com/498702 がrubyの参考になる じゃあtwitterのstream APIをzeromqにして吐き出すpub側を作ってみる。stream APIは1台しか接続できないので、何かHUB的な物が欲しかった。 #!/usr/bin/env ruby r
Twitterには、ストリーミングAPIという、プッシュでリアルタイムに情報を受け取ることのできるAPIが用意されています。 これを使えば、定期的にポーリングをしたりすることなく、誰かが発言した時点で即座にメッセージを受け取れます。 しかし、これを使うためには、TCP接続をTwitterに対して張りっぱなしにしておく必要があり、Webアプリなどで使うのに敷居が高いと感じている人もいるのではないでしょうか。 今回は、「そんなことないよ、超簡単だよ」ということを、Rubyベースのサンプルで示したいと思います。 なぜそんなことが簡単にできるのか、その秘密を先に種明かしすると、Ruby用のWebサーバとして急速に人気を獲得し、デファクトの座をとりつつある「Thin」というWebサーバが、内部的にEventMachineという非同期サーバを使用しているので、その機能を使うことで、今までのWebアプリ
TwitterさんはたくさんAPIを公開しており, 開発者からしたら頭が下がる想いですが, その中でもちょっと特殊なStreaming API. Twitter API Wiki / Streaming API Documentation Public Timeline上を流れるつぶやきを次々と受け取るAPIですね. 種類があるのでとりあえず書いておきます. メソッドの種類 sampleメソッド Public Timeline上のつぶやきをランダムにピックアップし, 応答として返してくれるメソッドです. 「とりあえずどんな感じなのか知りたいんだけど」って人にもってこいです. URL http://stream.twitter.com/1/statuses/sample.format リクエストメソッド GET firehoseメソッド Public Timeline上の全つぶやきを応答とし
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く