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

New custom flags, better debug info, updated default behavior and documentation #50

Merged
merged 15 commits into from
Mar 30, 2022

Conversation

AlexKalopsia
Copy link
Contributor

@AlexKalopsia AlexKalopsia commented Mar 22, 2022

Hi there! First of all thanks for making facebook-delete, it's a really awesome tool. I am opening this PR to address a few issues that I (and other users) have encountered.

Please note that this is the very first time I write code in Go and I am aware some of this code is quite ugly, but hopefully it can still be ok and maybe you can find time to give some input.

Here are the main changes:

Custom flags

This fixes (almost entirely) #42

As shown in the updated README.md, I am introducing a few flags to run the program more quickly from terminal:

-customYears: allows to define comma separated years and skip the menu selection
-customMonths: allows to define comma separated months and skip the menu selection
-selectAllContent: allows to select every content type and skip the menu selection

For the first two flags, I am running some regex to be sure the user types valid input. If the input is not valid, they will be asked for manual input as by default behavior.

For the months specifically, I made a map (pretty ugly, and I wonder if you have any input on how to make this suck less) that allows both single and double digits. I saw that the code base relies on strings (ie Jan, Feb, ...), but it felt more universal (and easier to validate input) to rely on digits instead. I also allow the option all to do full selection as well.

For content type I only put a single boolean because I didn't really have time to implement proper validation for each type of content.

Better debug info

While this doesn't fully fix #38, it does throw now a panic related to the program not being able to parse the cookies. It also points the user to the location of the cookie file that can be deleted to fix the issue. I have tried to manually nuke the cookies using RemoveAll() but with no positive result. The current solution is better than a generic out of range panic, though.

Updated default behavior

My experience is that with limitRate set to 0, Facebook will currently block your activity feed right away. Many other users reported the same issue. I do all my queries at 140000 ms rate now, and that's the only way I can currently circumvent the issue. Still, I set the new default to 30000 ms, and prompted the user to play around with this value a bit to find what works for them. Again, not ideal, but 0 is basically an insta-block right now :(

Documentation

Finally, I tried and document all of the above in the clearer way possible on the README.md file.


Once again, apologies if some of this code is really ugly. If you don't have time to review and don't want to merge that's also completely fine. Thanks again for making this tool available.

Copy link
Owner

@marcelja marcelja left a comment

Choose a reason for hiding this comment

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

Thanks a lot. Looks good to me. I added a few small comments.

README.md Outdated Show resolved Hide resolved
deleter.go Outdated Show resolved Hide resolved
deleter.go Outdated Show resolved Hide resolved
AlexKalopsia and others added 2 commits March 29, 2022 09:53
Co-authored-by: Marcel Jankrift <marcel@jankrift.de>
Co-authored-by: Marcel Jankrift <marcel@jankrift.de>
@marcelja marcelja merged commit adbd456 into marcelja:master Mar 30, 2022
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.

index out of range [1] with length 1
2 participants