Coder Social home page Coder Social logo

monproweb / dev-wisdom-daily Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 110 KB

๐Ÿค– A Threads/Twitter bot that generates and Threads/Tweets quotes for developers, along with an image description using the OpenAI API. Built using Python, threads-net, Twitter, MongoDB and Google Cloud Platform.

Home Page: https://threads.net/@devwisdomdaily

License: GNU General Public License v3.0

Python 100.00%
openai twitter-bot google-cloud-functions google-cloud-pubsub google-cloud-scheduler python threads-net twitter mongodb

dev-wisdom-daily's Introduction

๐Ÿค– 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.

dev-wisdom-daily's People

Contributors

thomaserhel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aicodehunt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.