Skip to content

Retweets tweets containing the word 'alfajor' or 'alfajores'.

Notifications You must be signed in to change notification settings

arbolitoloco1/BotAlfajor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

BotAlfajor

This is a simple script which uses the Twitter API to search and retweet tweets containing the word 'alfajor' or 'alfajores'. Can be adapted for any other word the user may prefer.

Note: As of March 28, 2023, the original bot account has been suspended for violating Twitter's rules.

Usage

Environment variables

The script reads three different variables from the environment: TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, and BANNED_WORDS

  • TWITTER_CONSUMER_KEY: OAuth 1.0a Consumer Key, found in the Twitter Developer Portal
  • TWITTER_CONSUMER_SECRET: OAuth 1.0a Consumer Secret, found in the Twitter Developer Portal
  • BANNED_WORDS: A ,,, separated list of words that when present in a Tweet will make the script skip it

This link contains more info about the Twitter API and how to request an application.

I personally prefer to export/set these variables at the start of my cron file, but you can also set them in .bashrc for example.

This script requires Twitter API v2, so you will need elevated access.

OAuth 1.0a

This script needs access to your bot's Twitter Account.

  1. The first time it is run, an authorization URL will be printed out on your screen, which you will have to open on your browser while logged into your bot's account
  2. If everything is working correctly, the page should display an authorization box, by clicking "Authorize app", you are allowing your application to control the account
  3. After you clicked that button, you will see a PIN, copy it to the console where the script is running and press enter
  4. Now the access tokens will be stored in a JSON file, and you won't need to authorize the application again

About

Retweets tweets containing the word 'alfajor' or 'alfajores'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages