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

Include searching a username with a tag functionality #2164

Open
1 task done
Gregory-rt opened this issue Jun 11, 2024 · 8 comments
Open
1 task done

Include searching a username with a tag functionality #2164

Gregory-rt opened this issue Jun 11, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@Gregory-rt
Copy link

Description

With many sites (League of Legends, Valorant, Discord in the past) having introduced a username + tag way of identifying an account (e.g Theo#1213), I would like to propose the accomodation of such sites by allowing the user to input an optional tag when searching with sherlock. This would allow the addition of such sites to sherlock, since adding them without a way to input the tag would never result in a positive response from the site.

My proposal would be to add a --tag optional argument, which would be used when searching through sites that have been identified as tag_required in the json file. These sites could also have a # in the url of the json file indicating where the tag should be placed. (e.g https://www.leagueofgraphs.com/summoner/vn/Sophie-1911 this would be "url": "https://www.leagueofgraphs.com/summoner/vn/{}-#" since the username of the example is Sophie and 1911 is the tag).

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Gregory-rt Gregory-rt added the enhancement New feature or request label Jun 11, 2024
@roxerj
Copy link

roxerj commented Jun 12, 2024

Working on it, but using a "#" as a placeholder for a name tag is probably not a good idea since some URLs might already have this symbol. I think it's better to use "<>" or a second "{}".
I'm trying to add a new property when adding a website, something like a boolean variable "isTagRequired", and if set to True, user would be prompted to add a tag after the username, for example "sherlock user123#1337"

@Canusmellthatbag
Copy link

Canusmellthatbag commented Jun 12, 2024 via email

@Gregory-rt
Copy link
Author

Working on it, but using a "#" as a placeholder for a name tag is probably not a good idea since some URLs might already have this symbol. I think it's better to use "<>" or a second "{}". I'm trying to add a new property when adding a website, something like a boolean variable "isTagRequired", and if set to True, user would be prompted to add a tag after the username, for example "sherlock user123#1337"

I have been working on it as well. Your recommendation about # makes sense to me, I proposed it since it would be intuitive and would make the code more readable. Asking the user to add a tag would only make sense to me if he was using the --site optional argument which specifies which site to search for.

@roxerj
Copy link

roxerj commented Jun 12, 2024

Asking the user to add a tag would only make sense to me if he was using the --site optional argument which specifies which site to search for.

You're right, so I see 2 options:

  1. Only search for a username with tag in websites where isTagRequired is set to True; e.g. "sherlock user123#1337 --tag" would only check websites with isTagRequired. Otherwise "sherlock user123#1337" would work the same way it's been working till now.
  2. Dynamically check for a "#" symbol in the username arg, so if you enter "sherlock user123#1337", the tag would be detected automatically without using the "--tag" flag. Then proceed to only check the websites with isTagRequired.

Right now I'm proceeding with the 1st option, but it will be easy to change later

@Gregory-rt
Copy link
Author

Gregory-rt commented Jun 12, 2024

I have already done something pretty similar to the first one (only difference is that the user would have to type "sherlock user123 --tag 1337" for the input you mentioned) and the same functionality (ignoring all sites were tag isnt required). I was waiting for a member of sherlock to respond before opening a pr for that solution. Would you mind working on the second proposal you gave, so that the team could choose between the two?

Am terribly sorry for the inconvenience, and you can also continue working on the same solution as well.

@roxerj
Copy link

roxerj commented Jun 12, 2024

Yeah, sure, not a problem, even if your solution gets accepted first, I don't mind. Still having fun here

@ppfeister
Copy link
Member

Note that --tag/--tags is also being discussed for use as in #2088

@roxerj
Copy link

roxerj commented Jun 12, 2024

I have already created a PR, #2169

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

No branches or pull requests

4 participants