show !g snippet when available, title when not
This commit is contained in:
parent
1ecbacefc2
commit
5608c1cdc7
1 changed files with 3 additions and 2 deletions
|
@ -35,9 +35,10 @@ class Module(ModuleManager.BaseModule):
|
||||||
if "items" in page and len(page["items"]):
|
if "items" in page and len(page["items"]):
|
||||||
item = page["items"][0]
|
item = page["items"][0]
|
||||||
link = item["link"]
|
link = item["link"]
|
||||||
title = utils.parse.line_normalise(item["title"])
|
text = utils.parse.line_normalise(
|
||||||
|
item["snippet"] or item["title"])
|
||||||
event["stdout"].write(
|
event["stdout"].write(
|
||||||
"(%s) %s - %s" % (phrase, title, link))
|
"%s: %s - %s" % (event["user"].nickname, text, link))
|
||||||
else:
|
else:
|
||||||
event["stderr"].write("No results found")
|
event["stderr"].write("No results found")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue