Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic error handling and inclusion of retweet removal with logs #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

hybolic
Copy link

@hybolic hybolic commented Dec 8, 2023

added some error handling to the deleter
logs made in very basic form
much room for improvement but hopefully this can help someone else

more robust tweet delete with retweet check and other error handlings
nav clicking on login doesn't always go to login screen but sometimes clicks google signup
update load-data.js to include likes
added function to unlike stuff
added function to parse more arguments
@hybolic
Copy link
Author

hybolic commented Dec 10, 2023

further expansions made, now handles likes and retweets.
includes more commandline arguments to further imporve the experience
log file can be enabled or disabled at users choice

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
@hybolic
Copy link
Author

hybolic commented Dec 10, 2023

update readme to include changes made to further help users understand how to use the program

Copy link
Owner

@baruchiro baruchiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sent some changes here: hybolic#1

Please add them to your Pull Request and I will continue after that.

Thank you!!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@hybolic
Copy link
Author

hybolic commented Jan 5, 2024

i've pushed some changes as per recommendation
as for the log level, i am unsure how to implement it.

Copy link
Owner

@baruchiro baruchiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code needs more refactor, such as dividing it into functions per sibject (for example- function for likes, function for else, and function for deleting a tweet).

I don't know what is your experties with JS code. If you feel you need help, please let me know. If you feel you can't continue with this, I will continue your work.

Thank you very much!

src/load-data.ts Show resolved Hide resolved
src/load-data.ts Show resolved Hide resolved
Comment on lines +15 to +21
.action(function(file) {
fileValue = file;
})

.option("-d, --debug",
"writes debug information to log file"
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The better option in my opinion is to chain all the .option first, and the .action will be the last, with all the rest of the code inside it, so you don't need to decalre a global var fileValue.

Comment on lines +122 to +125
const options = await page.waitForSelector('article[data-testid="tweet"][tabindex="-1"] div[aria-label=More]', {
visible: true,
timeout: timeout_amount,
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The options seems to be unused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants