Skip to content

Repository files navigation

Twitter Post Automation 🚀

Overview

The Twitter Post Automation project is designed to increase user engagement on a personal Twitter account, targeting individuals interested in technology and coding. The project utilizes Python, Tweepy, Github Actions, and REST APIs to achieve its objectives. 🌐

Features

  1. Encouraging 100DaysOfCode Tweets 💬:

    • The script queries tweets related to the "100DaysOfCode" hashtag.
    • Retrieves user details from the tweets and replies to them with a random encouraging quote to motivate them in their coding streak.
  2. Tech-Meme Posting 😄:

    • Implements the functionality to extract random tech-meme images using JokeAPI.
    • Posts the extracted meme images as tweets to add a humorous touch to the Twitter account.
  3. Scheduled Execution with GitHub Actions 🕒:

    • Utilizes GitHub Actions workflow to schedule project execution based on specific time intervals each day.
    • Ensures that the automation runs seamlessly at predetermined times.

Code Structure

The main logic of the project is implemented in the Python script twitterBot_scratch.py, which contains the following key sections:

  • Tweet Encouragement Logic:

    • Queries tweets related to "100DaysOfCode" and replies with an encouraging quote.
  • Tech-Meme Posting Logic:

    • Fetches a random tech meme using the JokeAPI and posts it on Twitter.
    • Handles exceptions gracefully to ensure robust execution. 🛡️
  • Authentication and Setup:

    • Utilizes Tweepy for Twitter API interactions.
    • Includes necessary imports, credentials, and API setup. 🔐

Output Examples

image

image

Info2

image

How to Use

  1. Clone the repository to your local machine:
  2. Install the required dependencies:
    pip install -r requirements.txt
  3. Set up your Twitter API credentials by creating a file named credentials.py and providing the required keys and tokens.
  4. Adjust the scheduled execution time in the script if needed.
  5. Run the script:
    python twitterBot_scratch.py

Dependencies

  • Tweepy
  • Requests
  • PIL (Pillow)

Feel free to contribute, open issues, or provide feedback. 🎉

About

Automating the process of posting tech content relevant to developers (tips/tricks/memes)

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages