Basic Twitterbot Manager to create automated Tweets. Uses OpenAI's GPT-3 to randomize messages. Hosted on Akash Decentralized Cloud. This example is tested on Ubuntu.
MetaBrainz active Twitterbot is based on this example! See Tweet
Do not share your public domain (Akash uri) when using this example template! This is a basic example that is coded hastily in one go and meant for experimental purposes only. The Author and Owner of this repository can not be held liable for any loss resulting from using this code. It is rumored that using GPT-3 for twitter goes against OpenAI's TOS. Use at your own risk.
- Setup/Configure Developer accounts
- Get the required keys for the environment variables:
TWITTER_API_KEY
TWITTER_API_SECRET
TWITTER_BEARER_TOKEN
GPT_ORG_ID
GPT_API_KEY
- Set callback urls in Twitters Developer Portal:
- For Local:
http://127.0.0.1:5500/authenticate
- For Akash: See section
Test On Akash
Make sure to replace the above mentioned environment variables in .localtest
file.
sudo make build
sudo make up
- Go to:
http://127.0.0.1:5500/
- Insert callback url
http://127.0.0.1:5500/authenticate/
- Authorize using Twitter
- Call some endpoints (using curl, postman, etc)
Get started with Akash Docs
Edit the Makefile
and replace: <dckr_username>/<image-tag:version>
sudo make push
Once the image has been pushed to dockerhub:
- Edit the
deploy.yml
file. - Create a new deployment with Akashlytics.
- Select 'empty' and paste
deploy.yml
contents.
Make sure to replace the above mentioned environment variables in deploy.yml
file.
Additionally replace the image
value.
- Go to Akash uri, for example:
http://your-akash-uri.eu-west01-akash.provider.com
- Insert callback uri, for example:
http://your-akash-uri.eu-west01-akash.provider.com/authenticate/
- Authorize using Twitter
- Call some endpoints (using curl, postman, etc)
- NOTE: Do not share your public domain (Akash uri) when using this example template!
/create_tweetor
/list_tweetors
/remove_tweetor
/remove_all
http://127.0.0.1:5500/create_tweetor
{
"interval": {
"days":0,"hours":0, "minutes": 5, "seconds":0,
"start_date":"", "end_date":"","timezone":""
},
"gpt_use": 1,
"gpt_prompt": "Tweet something awesome about Elon Musk",
"gpt_prompt_topic": "@elonmusk",
"tweetor_type": 0,
"tweetor_name": "mytweetor",
"tweetor_message": ""
}
http://127.0.0.1:5500/list_tweetors
http://127.0.0.1:5500/remove_tweetor/mytweetor
http://127.0.0.1:5500/remove_all
Do not share your public domain (Akash uri) when using this example template! This is a basic example that is coded hastily in one go and meant for experimental purposes only. The Author and Owner of this repository can not be held liable for any loss resulting from using this code. It is rumored that using GPT-3 for twitter goes against OpenAI's TOS. Use at your own risk.