A quick tweak
This commit is contained in:
parent
ba0620aa39
commit
ff5a4b0e3b
|
@ -45,13 +45,11 @@ def google(inp):
|
||||||
title = http.unescape(result['titleNoFormatting'])
|
title = http.unescape(result['titleNoFormatting'])
|
||||||
content = http.unescape(result['content'])
|
content = http.unescape(result['content'])
|
||||||
|
|
||||||
if len(content) == 0:
|
if not content:
|
||||||
content = "No description available."
|
content = "No description available."
|
||||||
else:
|
else:
|
||||||
content = http.html.fromstring(content).text_content()
|
content = http.html.fromstring(content).text_content()
|
||||||
|
|
||||||
out = '%s -- \x02%s\x02: "%s"' % (result['unescapedUrl'], title, content)
|
out = '%s -- \x02%s\x02: "%s"' % (result['unescapedUrl'], title, content)
|
||||||
|
|
||||||
out = truncate_words(out, 300)
|
return truncate_words(out, 300)
|
||||||
|
|
||||||
return out
|
|
Reference in a new issue