https://github.com/fsjunior/twitter_cleaner
A small python script that allows you to delete your old tweets.
https://github.com/fsjunior/twitter_cleaner
filter-tweets python-script twitter twitter-archive
Last synced: about 2 months ago
JSON representation
A small python script that allows you to delete your old tweets.
- Host: GitHub
- URL: https://github.com/fsjunior/twitter_cleaner
- Owner: fsjunior
- License: gpl-3.0
- Created: 2020-02-27T17:55:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:42:11.000Z (about 3 years ago)
- Last Synced: 2025-08-20T08:59:21.608Z (7 months ago)
- Topics: filter-tweets, python-script, twitter, twitter-archive
- Language: Python
- Homepage: https://pypi.org/project/twitter-cleaner/
- Size: 33.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twitter Cleaner
A small python script that allows you to delete your old tweets.
## Installation
Use pip:
```bash
pip install twitter_cleaner
```
## How to use
1. [Apply for a Twitter Developer Account](https://developer.twitter.com/en/apply).
2. While you wait for Twitter to review and approve your Developer Account, [download your Twitter archive](https://help.twitter.com/en/managing-your-account/how-to-download-your-twitter-archive). Twitter limits the access of the tweets by the API, so the only way to retrieve your old tweets is using the Twitter archive.
3. When you receive your archive, you should look for a JS file with contains all your tweets (tweet.js).
4. After the approval of your Twitter Developer Account, [create an app](https://developer.twitter.com/en/apps).
**Don't forget**: you should set **Read and Write** in the *Access Permissions* settings.
5. Open the *details* page of the app that you created. Go for the *Keys and Tokens* tab. You will need the consumer and access token keys to use Twitter Cleaner.
6. Run:
``` bash
python -m twitter_cleaner --consumer_key \\
--consumer_secret \\
--access_token_key \\
--access_token_secret \\
--older_than \\
--file
```
### Filters
There are two filters available: filter tweets older than a date AND filter tweets newer than a date. If you need more filtering options, like filter tweets with less (or more) than a specific amount of engagement, please ask.