JavaScript/Flash bridge to the Twitter Streaming API -- LEGACY
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


| twStreamer |

Because we don't (yet) support Web Sockets on the Twitter Streaming API
(, the only method
available to connect to the Streaming API from Javascript is to rely on a
Flash intermediary. This library provides a very small SWF (2K when compiled),
that will connect to the Streaming API and then call back out to JavaScript
with the JSON status object once it is received.

This library is only, currently, suitable for proof of concept scenarios.

| Getting Started |

This library depends on both jQuery 1.4.2 ( and jQuery SWF
Object ( With those, the twstreamer.js
and TwStreamFlash.swf files in the same directory, and the JS scripts included
via script tags, it is as simple as

    // set up the connection
      .credentials(USERNAME, PASSWORD)
        function(tweet) {         // callback function
          // receive tweet
        'track',                  // api method (track, follow, etc.)
        'twitter',                // api query
        ''  // the host to connect to (optional)

    // good housekeeping, once the connection can be closed

At this time, the Streaming API still uses basic auth, so the call to

    credentials(USERNAME, PASSWORD)

requires basic auth credentials to connect. Once the credentials have
been supplied

    connect(handler, method, query, host)

will actually initiate the connect and begin to proxy Tweets. The "handler"
needs to take a single jQuery parsed JSON object as an argument -- that is the
actual Tweet.

The host to connect to is optional, but at this time,, the
default Streaming API endpoint, does not serve a crossdomain.xml file. Only
the does.

| Contributors |

Raffi Krikorian <>
Russell D'Sa <>
Premasagar Rose <>