Skip to content

SafeerAbbas624/Twitter_chatgpt_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Twitter_chatgpt_bot

Introduction

This script is a Python script that automates the process of logging into list of provided Twitter account, replying to tweets on both the main timeline page and the following page, and logging out of Twitter. It uses Selenium and OpenAI's GPT-3 model to generate replies.

Features

  • Logs into Twitter using a provided username and password.
  • Replies to tweets on the main timeline page based on the content of the tweets.
  • Replies to tweets on the following page based on the content of the tweets.
  • Replies are generated from chatgpt through its API.
  • Handles exceptions that may occur during the process.
  • Logs out of Twitter after completing the replying process.
  • Then logins for next account.

Installation for All Operating Systems

  1. Install Python: Download and install the latest version of Python from the official website (https://www.python.org/downloads/).

  2. Install Selenium: Open a terminal or command prompt and run the following command to install Selenium:

    pip install selenium
    
  3. Install OpenAI's GPT-3 model: Open a terminal or command prompt and run the following command to install the openai package:

    pip install openai
    
  4. Download the ChromeDriver: Download the appropriate version of the ChromeDriver for your operating system from the official website (https://chromedriver.chromium.org/downloads). Extract the downloaded file and add the path to the ChromeDriver executable to your system's PATH environment variable.

  5. Replace the placeholders in the script with your own Twitter API credentials, OpenAI API key, and desired usernames and passwords list.

  6. Run this command after downloading and changing the credentials in the file.

    python twitter_bot.py
    

Usage

To use this script, follow the installation instructions, replace the placeholders in the script with your own credentials, and run the script using the provided command. The script will log into Twitter, reply to tweets on both the main timeline page and the following page, and log out of Twitter.

Please note that this script is for educational purposes only and should not be used for malicious purposes. Always respect the privacy and security of others when using social media platforms.

About

Twitter bot that uses Selenium and OpenAI's GPT-3 model to reply to tweets on both the main timeline page and the following page. Here's a breakdown of the code

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages