Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 🌈

Awesome Lists containing this project

README

        


360macky Bot

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.