Add a '.env' file and insert these lines:
API_KEY='' # API key
API_SECRET='' # API key secret
ACCESS_TOKEN='' # Access token
ACCESS_SECRET='' # Access token secret
SCREEN_NAME='' # Twitter handle (without the @ character)
To get the API keys, you need to apply for a Twitter Developer account.
It's free and take ~5 minutes.
Lastly, add a banner template file with this specific name : twitter-banner.png.
You'll have to make sure the banner template file is an image in PNG format.
Besides, you'll have to resize it by following the official sizing recommendations:
- width: 1500px,
- height: 500px
i.e. 1500x500 in px
Install dependencies:
yarn
or
npm install
Start the app:
node index.js
Keep it running with a process manager like pm2 and have fun!
The script fetches new replies every 60 seconds (to avoid rate limit).
Eslint & Prettier have been configured on this repository. Don't forget to run them before each commit (or after a pull-request is rebased onto the latest commit of the main branch).
How to reformat with both eslint and prettier?
npm run lint:fix
How to run eslint?
npm run lint
Follow me on Twitter! @guillaume_rygn
Thanks!