- Create an app on apps.twitter.com
- Grab the Consumer Key (API Key) and Consumer Secret (API Secret) from Keys and Access Tokens
- Make sure you set the right access level for your app
- If you want to use user-based authentication, grab the access token key and secret as well
Make a package.json with the above packages:
yarn add twitter-lite sleep chalk dotenv
Create a .env
file like the following:
CONSUMER_KEY=xx
CONSUMER_SECRET=xx
ACCESS_TOKEN_KEY=xx
ACCESS_TOKEN_SECRET=xx
Replace the xx
with your actual credentials, duh.
If you're running a modern-ish version of node then you can use imports directly by adding this field on your package.json
{
"type": "module",
"scripts": {
"start": "node -r dotenv/config index",
"debug": "node inspect -r dotenv/config index"
}
}
Also added some useful scripts.
yarn start
Boom, it will recursively clean likes until it finishes...