A Node.js application that demonstrates how to detect Twitter user events in real-time. A blink(1) is used as the event indicator.
JavaScript
Latest commit 48ce416 Jul 2, 2015 @ryankicks ryankicks Screenshot

README.md

twitter-streaming-blink1

A Node.js application that demonstrates how to detect Twitter user events in real-time. These events include receiving a new follow, being mentioned in a Tweet, and having a Tweet favorited.

The two Twitter Streaming APIs used for this are the filter endpoint and the user endpoint.

In the example (blink.js), a blink(1) is used to indicate an event. If you do not have a blink(1), then you can still see the events via the console. There is also a simplified version of this example that removes the blink(1) code and focuses only on console output (console.js). This may be easier to follow if you are not interested in controlling LEDs or want to add your own event indicators.

alt text

Node Modules

To install:

npm install twit
npm install node-blink1

Configuring

Before using this application, you will need to create a Twitter app or use an existing one. You can do this at t.co/apps. Once you have created an app and have consumer keys and access tokens, enter this information into the Twit constructor (i.e. consumer_key, consumer_secret, access_token, and access_token_secret).

You will also want to update the screen_name variable to indicate which account you would like to track.

Running

To run the application while a blink(1) is plugged into your computer:

node blink.js

To run the same example that only uses console output:

node console.js

Credits

License

Released under the Apache license