Skip to content

michellecaii/twitter_quote_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐢 Dog Image and Inspirational Quote Tweeter Bot 🐾

Having a RUFF morning? This project is a simple Python application that uses Google's Gemini API to generate short inspirational quotes and posts them on Twitter along with random dog images. The bot is perfect for bringing a daily dose of positivity and cuteness to your Twitter feed!

✨ Features

  • πŸ• Fetches a random dog image from the Dog CEO's Dog API.
  • 🌟 Generates a short inspirational quote with a dog-related pun using Google's Gemini API.
  • 🐦 Posts the image and quote as a tweet on Twitter using Tweepy.

πŸ“‹ Prerequisites

To run this project, ensure you have the following:

  • 🐍 Python 3.9 or higher installed.
  • 🐀 Twitter Developer account with API keys and access tokens.
  • πŸ”‘ A Google Gemini API key. You can get one from Google AI Studio.

βš™οΈ Installation

  1. πŸ“₯ Clone the Repository

    Clone the repository to your local machine:

    git clone https://github.com/yourusername/dog-quote-tweeter-bot.git
    cd dog-quote-tweeter-bot
  2. πŸ“¦ Install Dependencies

    Install the required Python packages using pip:

    pip install tweepy requests shutil google-generativeai
  3. πŸ” Set Up Your API Keys

    • Obtain your Twitter API keys and access tokens from the Twitter Developer portal and set them in the script.

    • Obtain your Gemini API key from Google AI Studio and configure it in the quote_generator.py script.

    • It is recommended to use environment variables for API keys to ensure security:

      On Unix-like systems (Linux, macOS):

      export API_KEY="your_gemini_api_key"
      export TWITTER_CONSUMER_KEY="your_consumer_key"
      export TWITTER_CONSUMER_SECRET="your_consumer_secret"
      export TWITTER_ACCESS_TOKEN="your_access_token"
      export TWITTER_ACCESS_TOKEN_SECRET="your_access_token_secret"

      On Windows:

      set API_KEY="your_gemini_api_key"
      set TWITTER_CONSUMER_KEY="your_consumer_key"
      set TWITTER_CONSUMER_SECRET="your_consumer_secret"
      set TWITTER_ACCESS_TOKEN="your_access_token"
      set TWITTER_ACCESS_TOKEN_SECRET="your_access_token_secret"

πŸš€ Usage

  1. ▢️ Run the Script

    To post a tweet with a random dog image and an inspirational quote, run:

    python tweeter_bot.py

    Ensure that your API keys are correctly set up before running the script.

  2. πŸ“€ Output

    After running the script, a tweet will be posted on the authenticated Twitter account with a dog image and an inspirational quote.

πŸ“ Project Structure

dog-quote-tweeter-bot/
β”‚
β”œβ”€β”€ quote_generator.py   # Script for generating inspirational quotes using Gemini API
β”œβ”€β”€ tweeter_bot.py       # Main script for fetching images and posting tweets
β”œβ”€β”€ README.md            # Project documentation
└── requirements.txt     # List of Python dependencies

πŸ“ Example

Below is an example of what might be posted as a tweet:

Image: [A random dog picture]
Text: "Start your day pawsitively! Remember, no mutt-er what, you can fetch your dreams! 🐢"

🌐 View the Working Project

You can view an example live working project implementation on Twitter: @ca49324

🀝 Contributing

If you would like to contribute to this project, please fork the repository and submit a pull request with your changes. Make sure to follow the established coding style and include comments where necessary.

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“§ Contact

If you have any questions or suggestions about this project, feel free to contact me at [email protected].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages