Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelo-earth/bot
🤖 Bot for Twitter powered with Tweepy and GPT-4 🌈
https://github.com/marcelo-earth/bot
bot gpt-4 openai tweepy twitter twitter-bot
Last synced: 10 days ago
JSON representation
🤖 Bot for Twitter powered with Tweepy and GPT-4 🌈
- Host: GitHub
- URL: https://github.com/marcelo-earth/bot
- Owner: marcelo-earth
- License: mit
- Created: 2023-03-26T20:14:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-30T20:55:05.000Z (almost 2 years ago)
- Last Synced: 2025-01-01T00:42:22.577Z (17 days ago)
- Topics: bot, gpt-4, openai, tweepy, twitter, twitter-bot
- Language: Python
- Homepage: https://twitter.com/360mackyBOT
- Size: 890 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Marcelo Bot
🤖 Personal Twitter bot powered by GPT technology 🦄 - @360mackyBOT## 🚀 Concept
A funny Twitter bot that generates descriptions of a person every day. The bot uses the [GPT-4 model](https://openai.com/product/gpt-4) to generate the descriptions with [Tweepy](https://www.tweepy.org/) to post on Twitter.
It uses Tweepy cursor to get bot mentions, and then it uses the [GPT-4 model](https://openai.com/product/gpt-4) to generate the descriptions.
It also sends a notification to my WhatsApp number using [Twilio](https://www.twilio.com/), whenever the bot performs a tweet.
The purpose of this bot is to have fun, learn about Twitter API and perform some experiments with OpenAI GPT-4.
### 🤖 Current abilities
This bot has the following abilities:
- Describe owner's mood every day based on last tweet
- Answer questions in mentions
- Retweet and like owner's tweets## 💻 Development
The following is a guide to help you set up the bot on your machine.
### Creating an automated Twitter account
Create a [Twitter Developer Account](https://developer.twitter.com/en/apply-for-access) and create a [Twitter Account](https://twitter.com/i/flow/signup) for the bot.
Specify that your bot is [automated with a label](https://help.twitter.com/en/using-twitter/automated-account-labels).
Get all the needed keys and tokens from the [Twitter Developer Portal](https://developer.twitter.com/en/portal/dashboard).
### Setting up the script
Install the dependencies:
```bash
pip install -r requirements.txt
```Create a `.env` filling the variables from the `.env.example` file.
### Creating a cron job
In Mac OS, you can use the `crontab` command to create a cron job. In Linux, you can use the `cron` command. In Windows, you can use the `Task Scheduler` to create a cron job.
For example my cron job looks like this:
```
0 10 * * * /usr/bin/python3 /Users/marcelo/Documents/GitHub/twitter_bot/main.py
```Which means that the script will run every day at 10am.
## 📦 Deployment
You can deploy the bot on many platforms like [Google Cloud](https://cloud.google.com/), [Heroku](https://www.heroku.com/), [AWS](https://aws.amazon.com/), [Vercel](https://vercel.com/), etc.
It would only need a Python environment to run the script, and the packages installed.