Twitter Image Auto-Poster

This is a Python script designed to automate the process of posting images to Twitter from a specified directory. The script will post one image at a time at specified intervals, and move the posted images to a "SENT" folder to avoid reposting.

Features

  • Automatically post images to Twitter at specified intervals.
  • Move posted images to a "SENT" folder to avoid reposting.
  • Configurable wait time between posts.
  • Error handling to manage exceptions during the posting process.
  • Console output for monitoring script activity and progress.
  • Refreshes the image list to accommodate new images added while the script is running.
  • GUI for visual feedback and monitoring.

Description

The script scans a specified directory for images, posts one image at a time to Twitter, and moves the posted images to a "SENT" folder to avoid reposting. It will wait for a specified interval between posts, and provides console output to monitor its activity and progress. Additionally, it refreshes the image list at each interval to accommodate new images added while the script is running. A simple GUI is implemented using PyQt5 to provide visual feedback and monitoring.

Documentation

Setup:

  1. Install the required packages by running the following command:

    pip install -r requirements.txt
  2. Create a .env file in the same directory as the script, and add your Twitter API credentials:

    BEARER_TOKEN=your_bearer_token
    CONSUMER_KEY=your_consumer_key
    CONSUMER_SECRET=your_consumer_secret
    ACCESS_TOKEN=your_access_token
    ACCESS_TOKEN_SECRET=your_access_token_secret

Running the Script:

  1. Run the script using the command:

    python main.py
  2. The script will post one image at a time from the specified directory to Twitter, and move the posted images to a "SENT" folder.

  3. The script will output the progress to the console, including the remaining images count, successful posts, and countdown to the next post. The GUI will also provide visual feedback and monitoring.

License

MIT License

Contributors

  • Rodger Elliott
  • ChatGPT
  • Jorge Zepeda (provided Twitter authentication code)