Skip to content

This project aims to create a Twitter bot that will share a wide range of philosophical quotes every day, precisely at 9:00 AM. By using both the ZenQuotes API and the Tweepy library, the bot will be able to effortlessly find and post motivational and philosophical quotes on my twitter handle @thatdumbguyy

Notifications You must be signed in to change notification settings

anujeshify/QuoterX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuoterX

This project endeavors to develop a Twitter bot programmed to share a diverse array of inspirational quotes daily, scheduled precisely for 9:00 AM. Leveraging the ZenQuotes API alongside the Tweepy library, the bot will seamlessly curate and deliver thought-provoking content to engage and uplift its audience.

Prerequisites

Before running the script, make sure you have the following:

  1. Python 3 installed

    • If not installed, click here to download the latest version of Python.
  2. Tweepy library installed

    Run the following command in cmd if tweepy is not installed.

    pip install tweepy

    TweepyInstall

  3. Tokens and API Keys for Twitter Account Authentication and Access

    • Click here to learn more about Twitter's Developer Platform

Setup

  1. Clone the repository:

    git clone https://github.com/anujeshify/QuoterX.git
  2. Install the required libraries:

    pip install -r requirements.txt
  3. Create a config.py file and add your Twitter API keys and tokens:

    CONSUMER_KEY = 'your_consumer_key'
    CONSUMER_SECRET = 'your_consumer_secret'
    ACCESS_TOKEN = 'your_access_token'
    ACCESS_TOKEN_SECRET = 'your_access_token_secret'
    BEARER_TOKEN = 'your_bearer_token'
  4. Run the script in Command Prompt:

    python QuoterX.py
  5. If you want to keep the Python Script running as a background process, then use the following command

    start /B python QuoterX.py
  6. If you want to stop the Python Script, then first find the Process ID of the Python Script that is runnning using the following command

    tasklist | findstr "python"

This will show the python process with its PID (Process ID)

  1. Kill the process by using the following command on cmd

    taskkill /PID <process id> /F

Replace "Process id" with the PID displayed. A Demonstration of the same is given below - ProcessKill

How it works

  1. The script fetches a random quote from the ZenQuotes API.

  2. If the author of the quote is "Unknown", it fetches another random quote until a valid author is obtained.

  3. The script creates a tweet with the quote and author.

  4. The tweet is posted using the Tweepy library and your Twitter API credentials.

  5. The script runs continuously and checks the current time every second.

  6. If the current time is 9:00 AM, it tweets a new quote.

Documentation of Tools Used

  • Python - Python Programming Language
  • Tweepy - Tweepy is a publicly available open-source Python library.
  • ZenQuotes API - The ZenQuotes API is an incredibly easy to use data feed for your website or app.
  • Twitter Developer Platform - Guides and reference materials to use Twitter Developer Platform

Authors

Contribution

Contributions to this project are welcome! If you have any suggestions, bug fixes, or improvements, please feel free to open an issue or submit a pull request. For any queries reach me at anujeshbansaltoo@gmail.com

Acknowledgments

Special thanks to the contributors and developers of the libraries and tools used in this project, including tweepy and ZenQuotes API.

About

This project aims to create a Twitter bot that will share a wide range of philosophical quotes every day, precisely at 9:00 AM. By using both the ZenQuotes API and the Tweepy library, the bot will be able to effortlessly find and post motivational and philosophical quotes on my twitter handle @thatdumbguyy

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages