https://github.com/milan-sony/twitterbot
A bot🤖 that tweet quotes daily on twitter
https://github.com/milan-sony/twitterbot
python python-library python-script requests tweepy twitter-api twitter-bot
Last synced: 4 months ago
JSON representation
A bot🤖 that tweet quotes daily on twitter
- Host: GitHub
- URL: https://github.com/milan-sony/twitterbot
- Owner: milan-sony
- Created: 2023-02-05T16:28:01.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T17:51:23.000Z (about 2 years ago)
- Last Synced: 2025-01-10T11:46:48.366Z (5 months ago)
- Topics: python, python-library, python-script, requests, tweepy, twitter-api, twitter-bot
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
# TwitterBot
A bot🤖 that tweet quotes daily on Twitter tweetwithquotes
## Prerequisites
For sending an Email, you have to make necessary changes in your gmail account (refer youtube, Keyword: How to send a mail in python)
## Read documentation about
- Twitter API
- Tweepy## Libraries used
- `requests`
- `tweepy`
- `dotenv`## Run locally
You will need to install Python on you system, head over to https://www.python.org/downloads/ to download python.
(Dont Forget to tick `Add Python to PATH` while installing Python)Once you have downloaded Python on your system,
run the following command inside your terminal (only if your system is git enabled, otherwise download the zip file and extract it)```bash
git clone https://github.com/milan-sony/twitterbot.git
```Then go to the project folder
```bash
cd twitterbot
```(This is optional, but strongly recommended) Make a virtual environment
```bash
python -m venv venv
```Activate the virtual environment
```bash
venv/Scripts/activate
```If error occurs when activating virtual environment, run the following command
```bash
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
```Then Install the dependencies needed for this project
```bash
pip install -r requirements.txt
```Now run the script
```bash
python twitterbot.py
```## Working
This bot works in such a way that
1st it will send a request to the Quote API and it will get the JSON response back, then the quote is fetched from the JSON response and this response is posted on twitter. If any error messages occured or if the authentication from Quote API and twitter API failed, it will send an Email to the given Email Id.
## Points to be noted
You can use different API's for this project
Actually it's not 100% accurate, there are some faults while running the program (If any bug occurs or not running properly, exit the code by clicking `ctrl + c` in the terminal and run again `python twitterbot.py`)
## Future updates
- Try to add more features to the bot