[Documentation] WebSuggest #189

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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex May 2, 2017

Member

Thanks!

Member

polyvertex commented May 2, 2017

Thanks!

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex May 3, 2017

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@bege10

bege10 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}

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

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex May 10, 2017

Member

Referenced in package's docs

Member

polyvertex commented May 10, 2017

Referenced in package's docs

@polyvertex polyvertex closed this May 10, 2017

@lb28

This comment has been minimized.

Show comment
Hide comment
@lb28

lb28 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}

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