r / twstreamer Goto Github PK
View Code? Open in Web Editor NEWJavaScript/Flash bridge to the Twitter Streaming API -- LEGACY
JavaScript/Flash bridge to the Twitter Streaming API -- LEGACY
+------------+ | twStreamer | +------------+ Because we don't (yet) support Web Sockets on the Twitter Streaming API (http://apiwiki.twitter.com/Streaming-API-Documentation), 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 (http://jquery.com/) and jQuery SWF Object (http://jquery.thewikies.com/swfobject/). 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 jQuery.twstreamer .init() .credentials(USERNAME, PASSWORD) .connect( function(tweet) { // callback function // receive tweet console.log(tweet); }, 'track', // api method (track, follow, etc.) 'twitter', // api query 'betastream.twitter.com' // the host to connect to (optional) ); // good housekeeping, once the connection can be closed jQuery.twstreamer.disconnect(); 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, stream.twitter.com, the default Streaming API endpoint, does not serve a crossdomain.xml file. Only the betastream.twitter.com does. +--------------+ | Contributors | +--------------+ Raffi Krikorian <[email protected]> Russell D'Sa <[email protected]> Premasagar Rose <[email protected]>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.