Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 3.04 KB

README.md

File metadata and controls

78 lines (59 loc) · 3.04 KB

🤖 Developer Quote Instagram/Twitter Bot

This is a Instagram/Twitter bot that generates and posts/tweets developer quotes along with an image based on the description provided by the quote.

🚀 Technologies Used

📋 Prerequisites

  • Python 3.6 or higher
  • A Instagram business account
  • A Meta account
  • A Meta page linked to Instagram business account
  • A Twitter Developer account with API keys and access tokens
  • An OpenAI API key
  • A MongoDB database

🛠️ Setup

To set up this project locally, you will need to:

  1. Clone this repository: git clone https://github.com/monproweb/dev-wisdom-daily.git

  2. Install the required packages using pip: pip install -r requirements.txt

  3. Set the necessary environment variables:

    • TWITTER_API_KEY (Follow the official documentation to create a Twitter Developer account and obtain API keys and access tokens)
    • TWITTER_API_SECRET
    • TWITTER_ACCESS_TOKEN
    • TWITTER_ACCESS_TOKEN_SECRET
    • BEARER_TOKEN
    • OPENAI_API_KEY (Follow the official documentation to obtain an OpenAI API key)
    • TWITTER_ACCOUNT (Set this to the username of the Twitter account you want to use for posting the tweets, e.g., "@DevWisdomDaily")
    • MONGODB_USERNAME
    • MONGODB_PASSWORD
    • FACEBOOK_ACCESS_TOKEN
    • INSTAGRAM_USER_ID
    • GOOGLE_APPLICATION_CREDENTIALS
  4. Deploy the function to Google Cloud Functions using the following command:

    gcloud functions deploy trigger_tweet \
    --runtime python311 \
    --trigger-resource devwisdomdaily_tweet \
    --trigger-event google.pubsub.topic.publish \
    --entry-point trigger_tweet \
    --env-vars-file .env.json
  5. Create a topic in Google Cloud Pub/Sub

  6. Create a subscription for the topic

  7. Create a Cloud Scheduler job to trigger the function with a Pub/Sub target

🎯 Usage

Once the project is set up, the bot will automatically tweet/post a new developer quote with an image at the specified intervals set up in the Cloud Scheduler job.

🤝 Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you want to contribute code, please fork the repository and create a pull request.

🌟 Contributors

📝 TODO

Threads with official Graph API

📄 License

This project is licensed under the GNU General Public License v3.0.