Skip to content
Simple example of Twitter + Beanstalk + EventMachine + HTML5 WebSocket with no polling
Ruby
Find file
Pull request Compare This branch is 3 commits ahead, 3 commits behind rubenfonseca:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
client
.gitignore
Gemfile
README.textile
socket.rb
twitterfeed.rb

README.textile

Twitter Beanstalk WebSocket Example

Quick experiment of going from twitter to the browser, with no polling.

It goes something like this:

Twitter Stream → Filter → Beanstalk → EventMachine → WebSocket → HTML5 Browser

Requirements

  • Ruby
  • Beanstalk
  • gem install bundler

How To

  1. bundle install (first time, to install the dependencies)
  2. beanstalkd # start beanstalk
  3. ruby twitterfeed.rb twitter_username twitter_password # start the filter
  4. ruby socket.rb # on another shell

Then you can open client/index.html on a HTML5 WebSocket compatible browser (tested with Webkit nightly).

Read the code, and have fun! :)

Something went wrong with that request. Please try again.