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 installyarn devto 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 .envand configure envs. You'll need credentials from your Twitter account for the Twitter envs.- Configure envs
TRACKandNODE_ENV. IfTRACKis 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. IfTRACKis unset, the string 'javascript' is passed to the streaming filter, to ensure plenty of tweets to test the settings. SetNODE_ENV=productionto enable sending of tweets, in addition toconsole.loging them. yarn devstreamto 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.