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

Adding facility to support multiple errors #841

Merged
merged 26 commits into from
Nov 5, 2020

Conversation

h20190563
Copy link
Contributor

As of now, Sherlock supports only a single instance for error messages. I have added the functionality which can handle the list/array of error messages.
Taking an example of Tinder, it provides multiple kinds of error. So, I have added those error messages in the data.json file.
Now the core module sherlock.py only supports one error message in form of string. So I have modified that file and handled the case so that it can support a list/array of messages.
As a result, Tinder which was reporting False-Positives is handled, and now it returns correct results.
Also, this can be helpful in the future, in order to support multiple error messages for different sites.

@h20190563
Copy link
Contributor Author

@sdushantha Thank You so much for the detailed steps. I hope i followed the steps in perfect manner.

@sdushantha
Copy link
Member

Looks like everything went well 👍

But I'm a little unsure of why there is a very long commit history of the past commits in this PR. I have never encountered this before.

I tested everything and it seems to be running without and issue. I'll merge this PR and we'll see what happens to that long commit history.

@sdushantha sdushantha merged commit 2606ce1 into sherlock-project:master Nov 5, 2020
@sdushantha
Copy link
Member

Looks like the tests went well, but the commit history got populated with the long commit history. I still have no idea of why that happened, but it doesn't really matter.

Anyways, thank you for helping out! 😊

@h20190563
Copy link
Contributor Author

I am happy that my first open-source contribution was for Sherlock. Thanks for all the help.

@darvell
Copy link

darvell commented Nov 5, 2020

Late but, love this. Wish I had have had the time to do it myself when I mentioned it as an idea! Excellent.

@hoadlck
Copy link
Contributor

hoadlck commented Nov 5, 2020

This PR changes the schema of the data.json. Since there were earlier changes to Sherlock that hardcoded the tool to look at the latest on master before doing a query, all of the users of Sherlock are going to start failing.

For example, if I run a query with what I had on my hard drive, this is what I see:

(505)% python sherlock  hoadlck
Update Available!
You are running version 0.12.9. Version 0.13.0 is available at https://git.io/sherlock
[*] Checking username hoadlck on:
[+] BitBucket: https://bitbucket.org/hoadlck/
[+] Ebay: https://www.ebay.com/usr/hoadlck
[+] Facebook: https://www.facebook.com/hoadlck
[+] Flickr: https://www.flickr.com/people/hoadlck
[+] GitHub: https://www.github.com/hoadlck
[+] GitLab: https://gitlab.com/hoadlck
[+] Gravatar: http://en.gravatar.com/hoadlck
[+] Imgur: https://imgur.com/user/hoadlck
[+] Instructables: https://www.instructables.com/member/hoadlck
[+] PCPartPicker: https://pcpartpicker.com/user/hoadlck
[+] Reddit: https://www.reddit.com/user/hoadlck
[+] Slashdot: https://slashdot.org/~hoadlck
[+] SourceForge: https://sourceforge.net/u/hoadlck
Traceback (most recent call last):
  File "C:\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "sherlock\__main__.py", line 33, in <module>
    sherlock.main()
  File "sherlock\sherlock.py", line 600, in main
    timeout=args.timeout)
  File "sherlock\sherlock.py", line 331, in sherlock
    if not error in r.text:
TypeError: 'in <string>' requires string as left operand, not list

I know that I brought up this point when that change originally went in, but my concern did not seem real as no change had happened yet.

I think we can agree that the above crash message is not very user friendly.

If nothing else, everyone should be prepared for users coming back entering issues about Sherlock crashing on them. I still think that the compatibility should be handled more robustly. But, that is a different topic.

@sdushantha
Copy link
Member

@hoadlck I do remember you telling me that, but I completely forgot about it when working on this PR. You are correct, there is a very high chance that we might be bombarded with issues regarding the error thrown by Sherlock.

I do have a small idea to propose regarding this issue. We could have a file for notices or messages which we want the users to see. Sherlock would check this file on GitHub every time it ran and if there was a message, it would output that to the user. We could also have a "command word" such as <<kill>>, that would allow us to forcefully stop Sherlock and then have a message for them telling to go and get the latest version because the current version will not work with the updated data.json

@h20190563
Copy link
Contributor Author

@darvell Thank You for bringing up that idea! I hope this will help sherlock in long run.

@hoadlck Reason for that error is, that the local copy of sherlock on your machine fetches the data from the updated data.json file. If you update the whole copy to the current version, I guess it will fix this issue.

@h20190563
Copy link
Contributor Author

@h20190563 how can I use this for multiple issues I may have just as a end user experience with very little knowledge with devops

@lostnco1 I guess you are getting confused with multiple issues and multiple errors. Here we are talking about the multiple errors that the website might return. For multiple issues regarding sherlock you can use Issue Template and state your issues there.

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.

9 participants