Code Monkey home page Code Monkey logo

twitter-gpt-auto-post-bot---x.com---tweepy-python-bot's Introduction

๐Ÿฆ Twitter Auto-Post Bot ๐Ÿค–

Python Tweepy OpenAI

Schedule License: MIT

Automate your Twitter presence. Auto Post tweets from from openAI GPT4, from a file, from a string, schedule a new tweet to be posted daily or post the tweet instantly.


๐ŸŒŸ About The Project

This Python-based Twitter Auto-Post Bot automates tweeting, Credit to the Tweepy library for making this easy, this project enables scheduled and random tweets, offering a dynamic and engaging Twitter experience.

๐Ÿ“ Files Overview

Using OpenAI

Instantly:
  • src/instantly-tweet-from-openai.py: Immediately tweets a tweet from openAI api response, currently using GPT4, but you can change the model in functions.py

  • Prompt defined here
Schedule to auto post, tweet daily at a time:
  • src/schedule-daily-post-from-openai.py: Automates daily tweets, Runs daily at a scheduled time and queries open ai api to create a tweet, the tweet returned is then automatically tweeted each day to fully automate twitter on auto pilot. By default the model is OPENAI GPT4 but you can change the model in functions.py.
  • Prompt defined here
  • Schedule time defined here

From File

  • src/schedule-daily-post-from-file.py: Automates daily tweets, randomly selecting from tweets.txt. To change the schedule time edit this.
  • src/tweeter-random-from-file.py: Instantly posts a random tweet from tweets.txt.
Add your tweets to data/tweets.txt: one per line. They will be randomly selected and tweeted.

Manually tweeting using script

src/tweeter-from-code.py: Immediately tweets a pre-defined message with the current date, but you can change this to whatever you like.

common files

  • config/keys.py: Holds both the creds for openai and twitter api.
  • src/functions.py: Shared functions for generating tweets from openai and tweet posting
  • requirements.txt: Lists all necessary Python packages.

๐Ÿ“ Upcoming Features

  • Adding CLI.

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.x
  • Tweepy (Twitter API)

Installation

  1. Clone the repo:
    git clone [email protected]:lewispour/Twitter-auto-Post-Bot---X.com---Tweepy-python-bot.git
  2. Install Python packages:
    pip install -r requirements.txt

Setup

  1. Obtain Twitter API credentials here.
  2. update config/keys.py file with your credentials:
    bearer_token = "GET_KEY_FROM_developer.twitter.com/apps"
    api_key = "GET_KEY_FROM_developer.twitter.com/apps"
    api_secret = "GET_KEY_FROM_developer.twitter.com/apps"
    access_token = "GET_KEY_FROM_developer.twitter.com/apps"
    access_token_secret = "GET_KEY_FROM_developer.twitter.com/apps"
    openai_key = "GET_YOUR_OPENAI_API_KEY_FROM_https://platform.openai.com/api-keys"
  3. Customize data/tweets.txt with your tweets. (SKIP: If not using tweet from file)

๐Ÿ”ง Usage

Run any script using Python:

cd src/
python instantly-tweet-from-openai.py

๐Ÿค Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

๐Ÿ“ License

Distributed under the MIT License. See LICENSE for more information.

โœ‰๏ธ Contact

Project Link: https://github.com/lewispour/Twitter-auto-Post-Bot---X.com---Tweepy-python-bot

โœ‰๏ธ Status

  • Last tested and still working on 18/03/2024 โœ…

twitter-gpt-auto-post-bot---x.com---tweepy-python-bot's People

Contributors

lewispour avatar lewis1994lp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.