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

[Documentation] WebSuggest #189

Closed
bege10 opened this issue May 1, 2017 · 5 comments
Closed

[Documentation] WebSuggest #189

bege10 opened this issue May 1, 2017 · 5 comments
Labels

Comments

@bege10
Copy link

@bege10 bege10 commented May 1, 2017

Here are ways to localize the suggestions for German:

  1. Google: add a line "hl de" to the "api_args" to get German suggestions. (Is there a list of all the language -codes?)
  2. Same with Youtube
  3. Most people will know: change the first letters in the wikipedia url, eg. "de.wikipedia.org" for German.
  4. Yahoo needs additional "de" in the url: "https://de.search.yahoo.com"

Couldn't find it out for the other predefined providers.

Maybe it helps to add such hints to the documentation of the package and/or the config file.

@polyvertex
Copy link
Member

@polyvertex polyvertex commented May 2, 2017

Thanks!

@polyvertex
Copy link
Member

@polyvertex polyvertex commented May 3, 2017

@bege10 would you mind providing your WebSuggest config so I can just copy/paste it to the docs? I think it would be better than just let users trying to work their way out of it.

@bege10
Copy link
Author

@bege10 bege10 commented May 3, 2017

Cannot upload the file (error notice). So I have to paste it here.

[predefined_provider/Wikipedia]
# API references:
#   https://www.mediawiki.org/wiki/API:Main_page
#   https://www.mediawiki.org/wiki/API:Opensearch
# API example:
#   https://en.wikipedia.org/w/api.php?action=opensearch&search=foo&limit=10&namespace=0&profile=fuzzy&format=json
api_base = https://de.wikipedia.org/w/api.php
api_method = get
api_args =
    action opensearch
    search {terms}
    limit 10
    namespace 0
    profile fuzzy
    format json
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://de.wikipedia.org/wiki/Special:Search
browse_args =
    search {terms}
    go Go

[predefined_provider/Google]
# API example:
#   https://suggestqueries.google.com/complete/search?q=foo&client=firefox
api_base = https://suggestqueries.google.com/complete/search
api_method = get
api_args =
    q {terms}
    hl de
    client firefox
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://encrypted.google.com/search
browse_args = q {terms}

[predefined_provider/Yahoo]
api_base = https://de.search.yahoo.com/sugg/ff
api_method = get
api_args =
    output fxjson
    command {terms}
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://de.search.yahoo.com/search
browse_args = p {terms}

[predefined_provider/YouTube]
# API example:
#   https://suggestqueries.google.com/complete/search?q=foo&client=firefox&ds=yt
api_base = https://suggestqueries.google.com/complete/search
api_method = get
api_args =
    q {terms}
    hl de
    client firefox
    ds yt
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://www.youtube.com/results
browse_args = search_query {terms}
@polyvertex polyvertex added the area/docs label May 5, 2017
@polyvertex
Copy link
Member

@polyvertex polyvertex commented May 10, 2017

Referenced in package's docs

@polyvertex polyvertex closed this May 10, 2017
@lb28
Copy link

@lb28 lb28 commented Nov 11, 2017

@bege10 i added the one for amazon (thanks to this gist). It seems that there is no german api, but we can use the uk one...

[predefined_provider/Amazon]
api_base = https://completion.amazon.co.uk/search/complete
api_method = get
api_args =
    q {terms}
    search-alias aps
    mkt 4
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://www.amazon.de/s/
browse_args = field-keywords {terms}

[predefined_provider/Wikipedia]
# API references:
#   https://www.mediawiki.org/wiki/API:Main_page
#   https://www.mediawiki.org/wiki/API:Opensearch
# API example:
#   https://en.wikipedia.org/w/api.php?action=opensearch&search=foo&limit=10&namespace=0&profile=fuzzy&format=json
api_base = https://de.wikipedia.org/w/api.php
api_method = get
api_args =
    action opensearch
    search {terms}
    limit 10
    namespace 0
    profile fuzzy
    format json
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://de.wikipedia.org/wiki/Special:Search
browse_args =
    search {terms}
    go Go

[predefined_provider/Google]
# API example:
#   https://suggestqueries.google.com/complete/search?q=foo&client=firefox
api_base = https://suggestqueries.google.com/complete/search
api_method = get
api_args =
    q {terms}
    hl de
    client firefox
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://encrypted.google.com/search
browse_args = q {terms}

[predefined_provider/Yahoo]
api_base = https://de.search.yahoo.com/sugg/ff
api_method = get
api_args =
    output fxjson
    command {terms}
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://de.search.yahoo.com/search
browse_args = p {terms}

[predefined_provider/YouTube]
# API example:
#   https://suggestqueries.google.com/complete/search?q=foo&client=firefox&ds=yt
api_base = https://suggestqueries.google.com/complete/search
api_method = get
api_args =
    q {terms}
    hl de
    client firefox
    ds yt
api_headers =
    User-Agent Mozilla/5.0
api_parser = opensearch
browse_base = https://www.youtube.com/results
browse_args = search_query {terms}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.