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 ofsetTimeout
in mocked mode).
I’m currently working on a project based on twitter-stream-channels that I wil release in a few weeks.
Tophe
edit : I just released the project I was talking about. More about it on this post.
Hi Christophe,
First of all, many thanks for this npm package – it works great!
Second, I’d like to let you know that I submitted a PR for Typescript type definitions, here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19725
Fell free to modify it if you think it’s not good enough. I’m new to Typescript so I’m not sure if I followed the best practices.
Thanks.
Adrian
Hi Adrian,
I’m glad that you enjoy twitter-stream-channels.
Writing a TypeScript definition for this module is a great idea. I’ve reviewed your PR on github (I have used TypeScript in the passed but never wrote any .d.ts files – so I made comments more about the API fit than best practices, other people will do that).
Tophe