Twitter bot for generating photo descriptions (alt text)
MIT License
According to Twitter support bot account has been suspended due to violations of rules:
- Creating serial and/or multiple accounts with overlapping uses
- Evading a permanent suspension by creating or using another account
- Cross-posting Tweets or links across multiple accounts
- Aggressive following, particularly through automated means
Twitter: https://twitter.com/GramtionBot
Source Code: https://github.com/lRomul/gramtion
This repo contains the source code of the Twitter @GramtionBot for generating photo descriptions. Use cases and intends:
Tweet photo with mention @GramtionBot or reply with mention to a tweet with a photo and the bot will send you an auto-generated image description.
Gramtion is mainly built from ready-to-use third party libraries:
POST /2/tweets
.To run an instance of the bot you need to install Docker and create Twitter API auth credentials. If you have a Twitter developer account, but don't want to use it as a bot account, you can authenticate a new user thats not has a developer account with twurl.
Create .env
file with credentials.
CONSUMER_KEY={{ consumer_key }}
CONSUMER_SECRET={{ consumer_secret }}
ACCESS_TOKEN={{ access_token }}
ACCESS_TOKEN_SECRET={{ access_token_secret }}
Setup Google Vision AI and create account key (link). Copy key as google_key.json
.
Run Docker container with running the bot
docker run -d --restart=always \
--env-file .env \
-v google_key.json:/workdir/google_key.json \
--name=gramtion \
ghcr.io/lromul/gramtion:0.0.5
Open logs
docker logs -f gramtion
Stop container
docker stop gramtion
docker rm gramtion