This Python script fetches the replies to a specific tweet using the Twitter API from RapidAPI. It extracts and displays the usernames and account IDs of the users who replied to the tweet.
-
Clone the repository:
git clone https://github.com/yourusername/twitter-replies-fetcher.git cd twitter-replies-fetcher
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the required packages:
pip install -r requirements.txt
-
Replace
YOUR_RAPIDAPI_KEY
in the script with your actual RapidAPI key. -
Run the script:
python twitter_replies_fetcher.py
-
Enter the Tweet URL when prompted.
The script will print out the usernames and account IDs of the repliers.
- RapidAPI Key:
- Sign up on RapidAPI to get your API key.
- Replace
YOUR_RAPIDAPI_KEY
in the script with your actual RapidAPI key.
The script includes basic error handling to manage issues such as:
- Invalid tweet URLs.
- No replies found.
- HTTP errors during API calls.
If any errors occur, appropriate messages will be printed to help diagnose the issue.
Contributions are welcome! Please follow these steps to contribute:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature-branch-name
-
Make your changes and commit them:
git commit -m 'Add some feature'
-
Push to the branch:
git push origin feature-branch-name
-
Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.