With the Twitter Stream API, you can only open one stream at a time, so if you want to track different kinds of keywords (aka channels), all the tweets in result will be mixed up and you’ll need to do some post-processing to identify which tweet belongs to which channels.
I needed that kind of feature for my next project, so I decided to make a module out of it. Feel free to use it. Some infos you might be interested in :
- The API documentation (generated from source code with yuidoc)
- The github repo (with the README)
- twitter-stream-channels on npm –
npm install twitter-stream-channels
- The module has a complete built-in mock version accessible via
.getMockedClass() that will let you use it without connecting to Twitter (usefull because of their connexion limit)
- It also is unit-tested, if you want to contribute (first time I made unit-tests on node with mocked data dispatched by events – by the way, I improved test’s speed using
process.nextTick instead of
setTimeout in mocked mode).
I’m currently working on a project based on twitter-stream-channels that I wil release in a few weeks.
edit : I just released the project I was talking about. More about it on this post.
This project is more an experiment than really a game (it could lead to a game though). The concept is :
- you open the website on your desktop browser
- you snap the QR code with your smartphones (yours and friends’s or coworkers’s)
- then you control your ball which is on the desktop monitor by tilting your phone … like a wiimote.
This is multiplayer (each player has a ball of a certain color – moving on the monitor and identified on his phone), there is a little chat (if you play with multiple monitors).
If you don’t have any phone, you can even run the device motion emulator ! (thanks to remote-tilt).
It runs with :
The site is hosted on a free heroku instance (I recently enabled the WebSockets which weren’t available on heroku before – caused socket.io to fallback to xhr polling) so it’s not the best server ever, but it does the job for the demo …
The source code is on github, it’s MIT licensed if you want to fork it or whatever.
I’m aware it’s not perfect (if you’re on multiple monitors, you may experiment little display differences), but it could lead to an idea of game or whatever …!
Test Topheman Playground 2
PS : Besides of socket.io and little bugs I had to deal with (such as the express sessions linked to the sockets), this project forced me to learn how to publish a project on heroku, which is (when you never have done it before) not something as easy as uploading your files via ftp like you would for a php project for example 🙂 …