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

Make search engine link configurable, so I can easily make benchmark #95

Merged
merged 5 commits into from
Oct 8, 2020

Conversation

WindSoilder
Copy link
Owner

No description provided.

@dzervas
Copy link
Contributor

dzervas commented Oct 5, 2020

Wouldn't it be better to add some kind of templating in the URL? instead of "https://" + bing_url + "/search?q=" + query have something like format!(engine_url, query) where engine_url = "https://bing.com/search?q={}"

@WindSoilder
Copy link
Owner Author

WindSoilder commented Oct 5, 2020

Wouldn't it be better to add some kind of templating in the URL? instead of "https://" + bing_url + "/search?q=" + query have something like format!(engine_url, query) where engine_url = "https://bing.com/search?q={}"

Do you mean that I can make the https://bing.com/search rather than bing.com into my configuration file?

I'm afraid it's not friendly for users who wants to make some configuration(Maybe there are no case for it). In your solution, I have to make a configuration file like this:

[engine_domain]
duckduckgo = "http://duckduckgo.com/html?t=hj&ia=web&q="
bing = "http://www.bing.com/search?q="
google = "http://www.google.com/search?q="

or this:

[engine_domain]
duckduckgo = "http://duckduckgo.com/html"
bing = "http://www.bing.com/search"
google = "http://www.google.com/search"

User need to understand more information about the scheme, and path to make a successfully configuration, which is unnecessary. What do you think?

@dzervas
Copy link
Contributor

dzervas commented Oct 5, 2020

well you're not wrong about that, but which user is going to change the google url anyway

@WindSoilder
Copy link
Owner Author

There is another issue which need to be concerned:
If I make configuration like this:

[engine_domain]
duckduckgo = "http://duckduckgo.com/html"

What's the default value for this? http://.... or https://... ? I would like to keep use_https argument work in get_query_url function. And it may makes code harder to understand..

@WindSoilder
Copy link
Owner Author

Merge this for now, please fire a PR if there are better solutions for the code.

@WindSoilder WindSoilder merged commit c54a11e into master Oct 8, 2020
@WindSoilder WindSoilder deleted the benchmark branch October 8, 2020 00:19
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