A bot that listens for tweets from @NYCTSubway and retweets them along with a fake service change announcement. Follow @NotMTA to see it in action!
yarn install
yarn dev
to inspect some individual modules (served atlocalhost:5000
):/change
: text of a randomly-generated service change announcement./bullet
: a randomly-generated service bullet (the colored logos for each train line) using the MTA's font, layout and color schemes. In the future, this module could be used to generate fake service change posters like the ones you see hanging in the station./reason
: just a randomly-generated reasons for the service change.
cp .env.example .env
and configure envs. You'll need credentials from your Twitter account for the Twitter envs.- Configure envs
TRACK
andNODE_ENV
. IfTRACK
is set, the Twitter streaming client will be passed its value as the user ID of the Twitter account to follow. (Note that user IDs are not the same as Twitter usernames – a user ID is an integer.) @NYCTSubway is user ID66379182
. IfTRACK
is unset, the string 'javascript' is passed to the streaming filter, to ensure plenty of tweets to test the settings. SetNODE_ENV=production
to enable sending of tweets, in addition toconsole.log
ing them. yarn devstream
to connect to the Twitter Streaming API and start listening for tweets.
yarn test
to run tests. They're fairly limited right now, but I'm working on building them out, particularly for the filter module.
util/fetchtweet
is a small Node script for pulling tweet JSON objects from the Twitter REST API. It uses the credentials you've configured for the rest of the application. Pass it Tweet IDs as arguments.