Python script to delete old / embarrassing tweets.

Overview

Delete Tweets

Do you have hundreds of embarrassing tweets on your Twitter profile, that you tweeted over a decade ago as an innocent high schooler, that is now causing you to cringe any time you think about them?

No?

Well, me either. (With the help of this script!)

Prerequisits

Dev Environment

python3

Get Twitter API credentials

Follow the instructions here to generate the bearer and access tokens for the Twitter API. Verify that your access tokens allow read and write operations.

You should see something like this on your Twitter Developer Dashboard for your Project/App. Screen Shot 2022-04-13 at 2 48 54 AM

Make sure you copy and paste the Consumer API and Secret Keys, Bearer Token, and Access Token and Secret Keys, and store them in a safe place!

Export Twitter API keys as environment variables

In your terminal (or .bashrc, .bash_profile, .zshrc, etc.) export the API keys keys as evironment variables. These will be used by the python script.

export 'BEARER_TOKEN'='<your_bearer_token>'
export 'CONSUMER_KEY'='<your_consumer_key>'
export 'CONSUMER_SECRET'='<your_consumer_secret>'
export 'ACCESS_TOKEN'='<your_access_token>'
export 'ACCESS_SECRET'='<your_access_secret>'

Install Python modules

cd <your_local_path>/delete-tweets
pip install -r requirements.txt

Running the Script

The script will delete all your tweets that were authored before a given date. If you would like to delete tweets by another criteria, feel free to implement it, or create an issue / ask questions if you need help.

Set the Cutoff Date

Open main.py and update the DATE_CUTOFF variable to any date you would like. Save the file.

Run main.py

python main.py

Voila! All embrassing tweets removed!

Limitations

Due to the rate limits of the Twitter API, this script might take a while to complete depending on how many embarassing tweets you have. The DELETE operation can only do 50 requests every 15 minutes. This script has automatic back-off, so just let it run in the background and do its thing.

You might also like...
This is a simple Python bot to identify sentiments in tweets

Twitter-Sentiment ๐Ÿ‘‹ Hi There! ๐Ÿ“ฑ This is a simple Python bot to identify sentiments in tweets ๐Ÿ‘จโ€๐Ÿ’ป This project was made for study, and pratice. You

A python package that fetches tweets and user information in a very pythonic manner.

Tweetsy Tweetsy uses Twitter's underlying API to fetch user information and tweets and present it in a human-friendly way. What makes Tweetsy special

Twitter-Scrapping - Tweeter tweets extracting using python

Twitter-Scrapping Twitter tweets extracting using python This project is to extr

This Is Advanced Version Of Old Radio Player, An Telegram Bot to Play Radio/Music in Channel or Group Voice Chats.

Telegram Radio Player V2 An Telegram Bot to Play Radio/Music in Channel or Group Voice Chats. This is also the source code of the bot which is being u

Scrape Twitter for Tweets
Scrape Twitter for Tweets

Backers Thank you to all our backers! ๐Ÿ™ [Become a backer] Sponsors Support this project by becoming a sponsor. Your logo will show up here with a lin

Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.
Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.

Elonbot Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency. Here is how it works: Subscribes to someone's (elonmusk?) tweets

(@Tablada32BOT is my bot in twitter) This is a simple bot, its main and only function is to reply to tweets where they mention their bot with their @

Remember If you are going to host your twitter bot on a page where they can read your code, I recommend that you create an .env file and put your twit

 A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.
A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.

TgTwitterStreamer A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat. For Getting ENV's Refer this Link

Owner
Linda Zheng
:hello:
Linda Zheng
Python script to harvest tweets with the Twitter API V2 Academic Research Product Track

Tweet harvester Python script to scrape, collect, and/or harvest tweets with the Twitter API V2 Academic Research Product Track. Important note: In or

Thomas Frissen 2 Nov 11, 2021
This bot will delete messages containing blacklisted words in your telegram groups.

Profanity Detector Bot This bot will delete messages containing blacklisted words in your telegram groups. Made using ProfanityDetector.

Aditya 17 Oct 8, 2022
Quickly and efficiently delete your entire tweet history with the help of your Twitter archive without worrying about the pointless 3200 tweet limit imposed by Twitter.

Twitter Nuke Quickly and efficiently delete your entire tweet history with the help of your Twitter archive without worrying about the puny and pointl

Mayur Bhoi 73 Dec 12, 2022
This is a simple Telegram bot to Delete User Messages based on Groupmembers Votes. Heroku deployable

ibCleaner Bot This is a simple Telegram bot to Delete User Messages based on Groupmembers Votes. Deploy to Heroku Deploy locally Edit config.py and ad

null 8 Oct 21, 2022
Discondelete, is a Discord self-bot to delete dm's or purge all messages from a guild.

Discondelete Discondelete, is a Discord self-bot to delete dm's or purge all messages from a guild. Report Bug ยท Request Feature Table of Contents Abo

core 4 Feb 28, 2022
DeleteAllBot - Telegram bot to delete all messages in a group

Delete All Bot A star โญ from you means a lot to me ! Telegram bot to delete all

Stark Bots 15 Dec 26, 2022
A discord bot that can detect Nitro Scam Links and delete them to protect other users

A discord bot that can detect Nitro Scam Links and delete them to protect other users. Add it to your server from here.

Kanak Mittal 9 Oct 20, 2022
Discord Mass Edit is a unique, purging related Discord tool that differs from the regular mass delete.

Discord Mass Edit is a unique, purging related Discord tool that differs from the regular mass delete. This tool will automatically edit every message in a chosen channel and change it to a random string.

c0mpt0 1 Jul 27, 2022
Check AWS S3 instances for read/write/delete access

s3sec Test AWS S3 buckets for read/write/delete access This tool was developed to quickly test a list of s3 buckets for public read, write and delete

0xmoot 114 Dec 6, 2022
Slack bot to automatically delete yubisneeze / accidental yubikey presses

YubiSnooze Slack bot to automatically delete yubisneeze / accidental yubikey presses. It will search using the regex "[cbdefghijklnrtuv]{44}" and if t

Andrew MacPherson 3 Feb 9, 2022