Update plugins/google.py
This commit is contained in:
parent
0525797cd8
commit
0db9662c90
1 changed files with 4 additions and 1 deletions
|
@ -33,7 +33,7 @@ def google(inp):
|
|||
raise IOError('error searching for pages: %d: %s' % (
|
||||
parsed['responseStatus'], ''))
|
||||
if not parsed['responseData']['results']:
|
||||
return 'no results found'
|
||||
return 'No results found.'
|
||||
|
||||
result = parsed['responseData']['results'][0]
|
||||
|
||||
|
@ -45,6 +45,9 @@ def google(inp):
|
|||
else:
|
||||
content = http.html.fromstring(content).text_content()
|
||||
|
||||
if len(content) > 250:
|
||||
content = content[:250] + '...'
|
||||
|
||||
out = '%s :: %s :: %s' % (title, content, result['unescapedUrl'])
|
||||
|
||||
out = ' '.join(out.split())
|
||||
|
|
Reference in a new issue