Fork from plorry/VegAssist to retweet people looking for support going vegan for 5 Minutes 5 Vegans. https://5minutes5vegans.org
This bot tracks usage of the term "vegan" - and it's translated variants depending on the config - on Twitter's public stream, and processes each item, looking for exact matches on an array of preset phrases. This bot can be setup for multiple authorised accounts for the same app, retweeting messages matching only certain filters to only certain accounts.
Implements full verification of all supplied API credentials, to avoid potential headaches.
Visit https://developer.twitter.com/apps to register your own app and obtain the credentials to use. To register more users under your app, visit https://5minutes5vegans.org/twitteroauth to grant permission and obtain their access tokens.
- Run
yarn add 5m5v-bot
to install the bot to your environment - Copy the
5m5v-config.example.yaml
file innode_modules/5m5v-bot
into your own environment under5m5v-config.yaml
and configure the bot - Run
npx 5m5v-bot
to run the bot
- Clone this repository
- Run
yarn install
in the directory that you cloned this repository into - Copy the
5m5v-config.example.yaml
file to your own5m5v-config.yaml
and configure the bot - Run
node .
to run the bot
The configuration is loaded from 5m5v-config.yaml
in the working directory, which is likely either the directory of your cloned repository or the directory of your project where you installed the node package. The configuration format is YAML, with its options listed below.
You find this in your app on Twitter under "Keys and tokens" -> "Consumer API keys". It's listed as "API key".
Underneath the previous key, listed as "API secret key".
A list containing all users to retweet with. The first user listed will be used to listen to the Twitter stream with.
- Available for your developer account underneath the last two keys under "Access token & access token secret". It's listed as "Access token".
- For other accounts this is the
oauth_token
, obtainable at either https://5minutes5vegans.org/twitteroauth or your own OAuth implementation.
- Available for your developer account underneath the previous key, listed as "Access token secret".
- For other accounts this is the
oauth_token_secret
, obtainable at either https://5minutes5vegans.org/twitteroauth or your own OAuth implementation.
A list of filters that this user will be retweeting matches from.
A list of keywords that if found in a Tweet will exclude that Tweet from being retweeted.
The time to delay retweets with once a matching Tweet has been found. Defaults to two minutes.
Simply run yarn test
Retweets can be disabled for testing purposes by using the argument --dry-run
, e.g. node . --dry-run
. In dry run mode, matching tweets will be logged to the console but not retweeted.