A Twitter bot that retweets tweets matching a specific search rule.
- Action logging
- Character, term and word blacklisting
- Catching up the tweets that were missed during downtime
- Instant retweets with a maximum delay of 20s between each retweet which is only for not exceeding the API limits
Variable | Required | Description |
---|---|---|
CLIENT_ID |
Yes | OAuth 2.0 Client ID |
CLIENT_SECRET |
Yes | OAuth 2.0 Client Secret |
APP_BEARER |
Yes | App bearer token |
RULE |
Yes | Search rule (guide) |
TAG |
Yes | Search rule tag (e.g. Cool tweets) |
LOG_DESTINATION |
No | Path to log file |
Note: You can also provide these environment variables in
.env
.
After setting the variables, you will have to get a user token for your automation account:
- Set your app's callback URL to the following:
http://127.0.0.1:3000/callback
- Run authenticate.ts:
deno run --allow-env --allow-net --allow-read authenticate.ts
-
Visit http://127.0.0.1:3000/login.
-
Authenticate your account.
-
Copy the printed token in your console.
-
Run import.ts:
deno run import.ts
- Provide the token and skip the lastId prompt.
You can blacklist characters, words and/or terms so they are not retweeted. You
can do this by placing the characters, words and/or or terms you want to
blacklist inside a file called blacklist.txt
in the directory you run from.
- The characters, words, and/or terms should be separated by
\n
. - Each line is a regular expression that will make tweets not retweeted if they
match its text. Flags can be provided like this:
/regex/i
.
deno run --allow-env --allow-net --allow-read --allow-write main.ts
- You just DO WHAT THE FUCK YOU WANT TO.