Skip to content

daksh2k/smile_plz

Repository files navigation

Smile Please

MIT license CodeFactor GitHub last commit GitHub issues Total Lines Of Code GitHub repo size GitHub top language

Twitter bot which tweets a new random quote hourly. Deployed on Replit.

Quotes are from a custom 500k quotes dataset made from Goodreads stored in MongoDB hosted at Mongo Atlas.

There is also a secondary method for getting quotes using the Forismatic API, which is added as a fallback which can be used as a default.

The bot also has support for dividing the tweet in 2 if it is longer than 280 chars.

Checkout the tweets at:

Profile Image

Profile Image

Prerequisites

  • Get the twitter credentials from your Twitter Developer Account here.
  • By default the bot uses the db for quotes. If you want to use the API by default set quote-method environment variable to api.
  • To get access to Mongo Atlas. Register on MongoDB Cloud.
  • For hosting. Register on Replit or choose any other provider of your choice.

Usage

For using this bot clone this repositary and install the dependencies from the requirements file.

  • Enter your details in a .env file like this(for Local Environment ):

    • consumer_key = "XXXXXXXXXXXXXXXXXXXX"
    • consumer_secret = "XXXXXXXXXXXXXXXXXXXXXX"
    • access_token = "XXXXXXXXXXXXXXXXXXXXXXX"
    • access_token_secret = "XXXXXXXXXXXXXXXXXXXX"
  • Optional variables-:

    • quote_method = "db or api" (db by default)
    • database_uri = "Your Mongo Atlas URI" (Required if quote_method is db)
    • platform_type = "local,replit" (local by default )
    • twitter_profile = "twitter profile url" (https://twitter.com/smile_plz12 by default)
    • logging = "off or on" (off by default)
    • HOST = "Host url" (localhost by default)
    • PORT = "Port number"(8080 ny default)
  • Or set these variables in your deployed environment.

Then run the main.py file to execute your bot.