Skip to content

Commit 69895a2

Browse files
committed
readme update and bugfix
update readme to reflect changes made fixed small bug in if/else statement in args to allow users to use smaller the 5000ms but still warn them changed the user url from "baruchiro" to "x" just incase Twitter makes an issue of this
1 parent b08eda2 commit 69895a2

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
1-
# Delete Your Old Tweets
1+
# Delete Your Old Tweets, Retweets And Likes
22

3+
1. this application will require [NodeJS](https://nodejs.org/en/download/current) and [Yarn](https://classic.yarnpkg.com/lang/en/docs/install/) to run
34
1. [Download your Twitter archive](https://twitter.com/settings/download_your_data), which contains all your tweets.
4-
1. Locate the JSON contains your tweets, which is `data/tweet.js` (or `data/twitter-circle-tweet.js`) in the archive.
5+
2. Locate the JSON contains your tweets, which is `data/tweet.js` (`data/like.js` or `data/twitter-circle-tweet.js`) in the archive.
6+
7+
3. Choose one of the following
8+
9+
## To Delete tweets
510
1. Run this project with `yarn && yarn start data/tweet.js`.
6-
1. It will wait you for login
7-
1. After login, it will delete all your tweets.
11+
2. It will wait you for login
12+
3. After login, it will delete all your tweets.
13+
14+
## To Delete Twitter circle tweets
15+
1. Run this project with `yarn && yarn start data/twitter-circle-tweet.js`.
16+
2. It will wait you for login
17+
3. After login, it will delete all your circle tweets.
18+
19+
20+
## To Unlike previously Liked tweets
21+
1. Run this project with `yarn && yarn start data/like.js`.
22+
2. It will wait you for login
23+
3. After login, it will unlike your likes.
24+
25+
26+
## Commandline Arguments
27+
28+
| argumensts | |
29+
| ------------- |:-------------:|
30+
| -debug | writes debug information to log file |
31+
| -log | writes log information to log file |
32+
| -exlog | writes all information from log and debug to log file |
33+
| -nolog | forces app to run without making a log file, could be helpful if removing large amounts of tweets/retweets/likes |
34+
| -skip %number% | skips up to the index given, good if you had to close the app or it crashed and don't have time to rerun the entire file |
35+
| -delay %ms% | the delay used between actions, try not to use below 5000ms as this could cause rate limiting |
36+
| -timeout %ms% | the timeout amount used after tweet is loaded (helpful on low bandwidth connections), try not to use below 5000ms as this could cause rate limiting |

src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,14 @@ for (const arg of process.argv)
4040
var arg_delay = Number(process.argv[i+1]);
4141
if(arg_delay < 5000)
4242
console.log("Lower then 5000ms delay could cause rate limiting!");
43-
else
44-
delay_amount = arg_delay;
43+
delay_amount = arg_delay;
4544
break;
4645
}
4746
case "-timeout" : {
4847
var arg_timeout = Number(process.argv[i+1]);
4948
if(arg_timeout < 5000)
5049
console.log("Lower then 5000ms could cause false positives when checking for page elements!");
51-
else
52-
timeout_amount = arg_timeout;
50+
timeout_amount = arg_timeout;
5351
break;
5452
}
5553
}
@@ -120,7 +118,7 @@ for (const arg of process.argv)
120118
if(tweet_index < skipTo)
121119
continue;
122120
if(isLikes){
123-
await page.goto(`https://twitter.com/baruchiro/status/${tweet.tweetId}`);
121+
await page.goto(`https://twitter.com/x/status/${tweet.tweetId}`);
124122
try{
125123
//check for options menu, if it times out we log the error and continue to next instance
126124
const options = await page.waitForSelector('article[data-testid="tweet"][tabindex="-1"] div[aria-label=More]', { visible: true, timeout: timeout_amount });
@@ -159,7 +157,7 @@ for (const arg of process.argv)
159157
}
160158
}
161159
else{
162-
await page.goto(`https://twitter.com/baruchiro/status/${tweet.id}`);
160+
await page.goto(`https://twitter.com/x/status/${tweet.id}`);
163161
try{
164162
//check for options menu, if it times out we log the error and continue to next instance
165163
const options = await page.waitForSelector('article[data-testid="tweet"][tabindex="-1"] div[aria-label=More]', { visible: true, timeout: timeout_amount });

0 commit comments

Comments
 (0)