Skip to content

Motivational Quote Bot is a Python-powered Twitter bot that uses OpenAI's GPT-3 to generate and post daily motivational quotes tailored for Gen Z and Millennial hustlers in Kenya. Built with automation in mind using GitHub Actions. πŸ’¬πŸ‡°πŸ‡ͺπŸš€

Notifications You must be signed in to change notification settings

kisilumueti/motivational-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Motivational Quote Bot πŸš€

Welcome to the Motivational Quote Bot! This simple yet powerful bot generates daily motivational quotes using OpenAI's GPT-3 and posts them to Twitter. It's the perfect way to keep your Twitter feed filled with positive vibes and hustle energy. Let's get inspired, one tweet at a time! πŸ’ͺ

πŸ‘€ Built with πŸ’» and β˜• by a BBIT student passionate about tech & motivation.
πŸ“¬ Contact: @johnboscomueti | Email: muetijohnbosco35@gmail.com


🎯 Purpose

The bot's goal is to:

  • Generate unique, tweet-length motivational quotes.
  • Use OpenAI’s powerful GPT-3 model for crafting custom content.
  • Post these quotes automatically to your Twitter account.
  • Inspire and energize Gen Z & Millennials, especially from the urban hustle in Kenya. 🌍

✨ Key Features

  • AI-powered Motivational Quotes: Generated by OpenAI’s GPT-3 model, the quotes are tailored for urban African millennials.
  • Twitter Integration: The bot posts directly to your Twitter account via Tweepy.
  • Customizable: You can tweak the style of quotes or adjust the post frequency.

πŸ› οΈ Technologies Used

  • Python: The language used to build the bot.
  • OpenAI API: The brain behind the motivational quotes.
  • Tweepy: Python library used to tweet the quotes.
  • GitHub Actions: To automate the daily tweeting.

πŸ’‘ Getting Started

Follow the steps below to set up the bot on your local machine or cloud server:

1️⃣ Install Dependencies

###bash pip install openai tweepy

2️⃣ Set Up API Keys You will need credentials for both OpenAI and Twitter:

OpenAI: Get your API key

Twitter: Create a Twitter Developer App

Then, set the following environment variables: export OPENAI_API_KEY="your_openai_api_key" export TWITTER_CONSUMER_KEY="your_twitter_consumer_key" export TWITTER_CONSUMER_SECRET="your_twitter_consumer_secret" export TWITTER_ACCESS_TOKEN="your_twitter_access_token" export TWITTER_ACCESS_TOKEN_SECRET="your_twitter_access_token_secret"

3️⃣ Run the Bot To post a single quote:

bash python post_quote.py This will generate a motivational quote and tweet it instantly. βœ…

4️⃣ Automate with GitHub Actions Create the following workflow file in your repo:

πŸ“ .github/workflows/bot.yml name: Post Motivational Quotes

on: schedule: - cron: "0 9 * * *" # Every day at 9:00 AM UTC

jobs: post_quote: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v2

  name: Set up Python
    uses: actions/setup-python@v2
    with:
      python-version: '3.x'

  - name: Install Dependencies
    run: |
      pip install openai tweepy

  - name: Run Bot
    run: |
      python post_quote.py

πŸ” Now your bot will post a motivational quote every morning at 9:00 AM UTC!

πŸ“¦ Code Overview post_quote.py does the following:

Generates a motivational quote from GPT-3 with keywords like glow up, money moves, and Kenyan hustle.

Posts that quote using the Tweepy Twitter API.

Uses environment variables to keep your credentials secure.

🚧 Troubleshooting RateLimitError from OpenAI?

You’ve likely hit your free usage cap.

Add billing to your OpenAI account or wait for quota reset.

Implement retry logic to handle temporary errors (e.g. exponential backoff).

🀝 Contributing Found a bug? Want to improve quote style? Pull requests and forks are welcome!

πŸ“„ License This project is open-source and available under the MIT License.

πŸŽ‰ Final Words Enjoy the positive vibes, and let’s keep the Kenyan hustle strong! Start your mornings with πŸ”₯ energy and πŸ’― mindset. Keep glowing. Keep going.


If you'd like, I can help generate a post_quote.py, .env.example, and requirements.txt to fully complete the repo setup. Let me know!

About

Motivational Quote Bot is a Python-powered Twitter bot that uses OpenAI's GPT-3 to generate and post daily motivational quotes tailored for Gen Z and Millennial hustlers in Kenya. Built with automation in mind using GitHub Actions. πŸ’¬πŸ‡°πŸ‡ͺπŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages