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:
-
Check out the bot at this Twitter Profile.
-
Or on the Replit Website where timeline is shown using Twitter Widgets.
- 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 toapi
. - To get access to Mongo Atlas. Register on MongoDB Cloud.
- For hosting. Register on Replit or choose any other provider of your choice.
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)
- quote_method = "db or api" (