SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
update github engine and add comments
Thomas Pointhuber334a286c1865
diff --git a/searx/engines/github.py b/searx/engines/github.pyindex d36797aba..53fec029f 100644--- a/searx/engines/github.py+++ b/searx/engines/github.py@@ -1,31 +1,59 @@+## Github (It)+#+# @website https://github.com/+# @provide-api yes (https://developer.github.com/v3/)+#+# @using-api yes+# @results JSON+# @stable yes (using api)+# @parse url, title, content+from urllib import urlencodefrom json import loadsfrom cgi import escape+# engine dependent configcategories = ['it']+# search-urlsearch_url = 'https://api.github.com/search/repositories?sort=stars&order=desc&{query}' # noqaaccept_header = 'application/vnd.github.preview.text-match+json'+# do search-requestdef request(query, params):params['url'] = search_url.format(query=urlencode({'q': query}))+params['headers']['Accept'] = accept_header+return params+# get response from search-requestdef response(resp):results = []+search_res = loads(resp.text)++ # check if items are recievedif not 'items' in search_res:- return results+ return []++ # parse resultsfor res in search_res['items']:title = res['name']url = res['html_url']+if res['description']:content = escape(res['description'][:500])else:content = ''- results.append({'url': url, 'title': title, 'content': content})++ # append result+ results.append({'url': url,+ 'title': title,+ 'content': content})++ # return resultsreturn resultsdiff --git a/searx/settings.yml b/searx/settings.ymlindex c6227212e..1d5f36a57 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -66,7 +66,6 @@ engines:- name : githubengine : github- categories : itshortcut : gh- name : google