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

Comments

@bege10
Copy link

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 commented May 2, 2017

Thanks!

@polyvertex
Copy link
Member

@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 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
Copy link
Member

Referenced in package's docs

@lursyy
Copy link

lursyy 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
Development

No branches or pull requests

3 participants