Install Process manager:
npm install pm2 -g
Install all dependencies:
npm install
Edit config.js and use your own credentials on twitter and redis, and keyword.
-
You have to be Register on twitter and then create an app, after that you will get you consumer and access token keys and secrets. More info on Access tokens
-
Keyword (default is #sxsw)
-
Redis server credentials (Default config is local)
pm2 start pm2.json
It will run two process, one with the worker, and another with Express running on port 3000 serving data.
Point your browser:
- List tweets by hashtag http://localhost:3000/hashtag/sxsw
- Show tweet: http://localhost:3000/tweet/123456
- Go and get a free account on Heroku
- Please create an app with rediscloud service on dashboard.
- Set your own credentials on heroku env vars on dashboard, look config.js
- Setup your git remote pointing to heroku app:
git remote add heroku git@heroku.com:{heroku-app-name}.git
To deploy On branch master and on git clone root dir:
git subtree push --prefix twitter-stream/express-api/ heroku master
Worker dont start until:
heroku ps:scale worker=1