-
Notifications
You must be signed in to change notification settings - Fork 48
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marcelja
reviewed
Mar 28, 2022
There was a problem hiding this 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.
Co-authored-by: Marcel Jankrift <marcel@jankrift.de>
Co-authored-by: Marcel Jankrift <marcel@jankrift.de>
marcelja
approved these changes
Mar 30, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 selectionFor 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 optionall
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 at140000
ms rate now, and that's the only way I can currently circumvent the issue. Still, I set the new default to30000
ms, and prompted the user to play around with this value a bit to find what works for them. Again, not ideal, but0
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.