summaryrefslogtreecommitdiff
path: root/searx/engines/google_news.py
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-31 16:38:03 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-31 16:38:03 +0100
commitb7dc1fb9d572d53d04c0120d96c76a20a418cc94 (patch)
treed367f21a1d2c52ec6cde71b980f2b7a0fa1e199c /searx/engines/google_news.py
parentd5b8005ee10054b5260f57c1800ddebfa03c39cf (diff)
downloadsearxng-b7dc1fb9d572d53d04c0120d96c76a20a418cc94.tar.gz
searxng-b7dc1fb9d572d53d04c0120d96c76a20a418cc94.zip
Google news' unit test
Diffstat (limited to 'searx/engines/google_news.py')
-rw-r--r--searx/engines/google_news.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/google_news.py b/searx/engines/google_news.py
index eb114f9c9..3e4371b99 100644
--- a/searx/engines/google_news.py
+++ b/searx/engines/google_news.py
@@ -20,7 +20,7 @@ language_support = True
# engine dependent config
url = 'https://ajax.googleapis.com/'
-search_url = url + 'ajax/services/search/news?v=2.0&start={offset}&rsz=large&safe=off&filter=off&{query}&hl={language}' # noqa
+search_url = url + 'ajax/services/search/news?v=2.0&start={offset}&rsz=large&safe=off&filter=off&{query}&hl={lang}'
# do search-request
@@ -33,7 +33,7 @@ def request(query, params):
params['url'] = search_url.format(offset=offset,
query=urlencode({'q': query}),
- language=language)
+ lang=language)
return params
@@ -52,6 +52,8 @@ def response(resp):
for result in search_res['responseData']['results']:
# parse publishedDate
publishedDate = parser.parse(result['publishedDate'])
+ if 'url' not in result:
+ continue
# append result
results.append({'url': result['unescapedUrl'],