Skip to content

Commit b1aa1ab

Browse files
upload files
0 parents  commit b1aa1ab

3 files changed

Lines changed: 125 additions & 0 deletions

File tree

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Delete Tweets & Likes Script
2+
[![CI][ci-image]][ci-url]
3+
4+
if you want to delete all of your tweets and the tweets that you like, this script can help you.
5+
#### 🟢it's all free!
6+
7+
8+
9+
# How To Run This Script
10+
11+
### for deleting your tweets:
12+
#### 1️⃣ login into your tweeter account: https://twitter.com/i/flow/login from your PC browser.
13+
#### 2️⃣ go to your profile page: https://twitter.com/{your-account-username} -> Example https://twitter.com/alirezakargar_b
14+
#### 3️⃣ right click and select inspect
15+
#### 4️⃣ go to Console page
16+
#### 5️⃣ copy code is delete_tweets.js file and paste them is the Console page and press Enter button
17+
18+
#
19+
20+
### for deleting your Likes:
21+
#### 1️⃣ login into your tweeter account: https://twitter.com/i/flow/login from your PC browser.
22+
#### 2️⃣ go to your profile page and click on **Likes section**: https://twitter.com/{your-account-username}/likes -> Example https://twitter.com/alirezakargar_b/likes
23+
#### 3️⃣ right click and select inspect
24+
#### 4️⃣ go to Console page
25+
#### 5️⃣ copy code is delete_likes.js file and paste them is the Console page and press Enter button
26+
27+
## Author
28+
29+
👤 **Alireza Kargar**
30+
31+
- Twitter: [@alirezakargar_b](https://twitter.com/alirezakargar_b)
32+
- Github: [@alirezakargar1380](https://github.com/alirezakargar1380)

delete_likes.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// start - app settings
2+
// check this setting before run this script
3+
4+
/**
5+
* Timeout
6+
* this timeout is in seconds, if you set this to 5,
7+
* every 5 second, this script will run
8+
*
9+
* NOTE:
10+
* increase timeout if any suspend or rate limit happens
11+
*/
12+
var timeout = 5;
13+
14+
// end - app settings
15+
16+
// app variables
17+
// Don't change this
18+
var deletedTweets = 0;
19+
timeout = timeout * 1000
20+
21+
var delTweets = function () {
22+
// get all your tweets number
23+
var tweetsRemaining = document.querySelectorAll('[role="heading"]+div')[1].textContent;
24+
console.log('Remaining: ', tweetsRemaining + ', deleted:', deletedTweets);
25+
26+
// un retweet tweets
27+
document.querySelectorAll('[data-testid="unlike"]').forEach(function (v3, i3, a3) {
28+
try {
29+
v3.click();
30+
deletedTweets++
31+
} catch (error) {
32+
console.error(error)
33+
}
34+
});
35+
36+
// scroll down to load more tweets
37+
window.scrollBy(0, 10000);
38+
}
39+
setInterval(delTweets, timeout); // run script multipile times

delete_tweets.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// start - app settings
2+
// check this setting before run this script
3+
4+
/**
5+
* Timeout
6+
* this timeout is in seconds, if you set this to 5,
7+
* every 5 second, this script will run
8+
*
9+
* NOTE:
10+
* increase timeout if any suspend or rate limit happens
11+
*/
12+
var timeout = 5;
13+
14+
// end - app settings
15+
16+
// app variables
17+
// Don't change this
18+
var deletedTweets = 0;
19+
timeout = timeout * 1000
20+
21+
var delTweets = function () {
22+
// get all your tweets number
23+
var tweetsRemaining = document.querySelectorAll('[role="heading"]+div')[1].textContent;
24+
console.log('Remaining: ', tweetsRemaining + ', deleted:', deletedTweets);
25+
26+
// delete tweets
27+
document.querySelectorAll('[aria-label="More"]').forEach(function (v, i, a) {
28+
v.click();
29+
document.querySelectorAll('span').forEach(function (v2, i2, a2) {
30+
if (v2.textContent === 'Delete') {
31+
v2.click();
32+
document.querySelectorAll('[data-testid="confirmationSheetConfirm"]').forEach(function (v3, i3, a3) {
33+
v3.click();
34+
deletedTweets++
35+
});
36+
} else {
37+
document.body.click();
38+
}
39+
});
40+
});
41+
42+
// un retweet tweets
43+
document.querySelectorAll('[data-testid="unretweet"]').forEach(function (v3, i3, a3) {
44+
v3.click();
45+
document.querySelectorAll('[data-testid="unretweetConfirm"]').forEach(function (v5) {
46+
deletedTweets++
47+
v5.click();
48+
});
49+
});
50+
51+
// scroll down to load more tweets
52+
window.scrollBy(0, 3000);
53+
}
54+
setInterval(delTweets, timeout); // run script multipile times

0 commit comments

Comments
 (0)