diff options
author | Adam Tauber <asciimoo@gmail.com> | 2017-05-18 22:06:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 22:06:07 +0200 |
commit | f4287b7e212767cd208ac4142d27fe806a811f99 (patch) | |
tree | 80e4538ad33fb81d76df3e513de06142b4c796f8 | |
parent | 9ee8e552da4654cd41228ce1a3addfa1fa1f377d (diff) | |
parent | 2a9339f4b7f24bd7f5f05730c3c998ed2a66b675 (diff) | |
download | searxng-f4287b7e212767cd208ac4142d27fe806a811f99.tar.gz searxng-f4287b7e212767cd208ac4142d27fe806a811f99.zip |
Merge pull request #925 from kvch/free-software-directory
Add free software directory engine
-rw-r--r-- | searx/engines/mediawiki.py | 6 | ||||
-rw-r--r-- | searx/settings.yml | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index 5a70204b1..33293cb43 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -21,6 +21,7 @@ categories = ['general'] language_support = True paging = True number_of_results = 1 +search_type = 'nearmatch' # possible values: title, text, nearmatch # search-url base_url = 'https://{language}.wikipedia.org/' @@ -30,7 +31,7 @@ search_postfix = 'w/api.php?action=query'\ '&format=json'\ '&sroffset={offset}'\ '&srlimit={limit}'\ - '&srwhat=nearmatch' # search for a near match in the title + '&srwhat={searchtype}' # do search-request @@ -39,7 +40,8 @@ def request(query, params): string_args = dict(query=urlencode({'srsearch': query}), offset=offset, - limit=number_of_results) + limit=number_of_results, + searchtype=search_type) format_strings = list(Formatter().parse(base_url)) diff --git a/searx/settings.yml b/searx/settings.yml index d9426033e..af91a18f4 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -209,6 +209,18 @@ engines: # Or you can use the html non-stable engine, activated by default engine : flickr_noapi + - name : free software directory + engine : mediawiki + shortcut : fsd + categories : it + base_url : https://directory.fsf.org/ + number_of_results : 5 +# what part of a page matches the query string: title, text, nearmatch +# title - query matches title, text - query matches the text of page, nearmatch - nearmatch in title + search_type : title + timeout : 5.0 + disabled : True + - name : frinkiac engine : frinkiac shortcut : frk |