Application that monitors a certain Twitter account and sends out a discord embed whenever a new tweet gets tweeted by that account. OCR is also supported.
npm install
You need to create a project on the Twitter developer portal, that'll give you access to an API.
Create a file named .env
and define the following things in the format below:
API_KEY=yourTwitterAPI
API_SECRET_KEY=yourTwitterAPISecret
ACCESS_TOKEN=yourTwitterAccessToken
ACCESS_TOKEN_SECRET=yourTwitterAccessTokenScret
BOT_TOKEN=yourDiscordBotToken
Don't forget that you will also need to adjust the channel ID for the webhooks in Discord in twitter.js
.
Don't include the @ when changing the account, only the displayname is needed, you can can include multiple accounts to be monitored at once.
The interval determines the number of milliseconds between each request to check for new tweets.
{
"accounts": ["acc1", "acc2"],
"latestTweets": {},
"interval": 5000
}
To set the OCR up follow these steps:
- Create a Google Cloud Platform account at https://console.cloud.google.com.
- Create a new project and enable the Cloud Vision API.
- Create a service account key with the role of "Project" > "Editor".
- Download the private key JSON file and rename it to ocr.json.
- Place the ocr.json file in your project directory.
- Authenticate your API calls with the ocr.json file.