mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-03 16:39:25 +01:00
Failed google now handled in googleSnarfer.
This commit is contained in:
parent
663a9f75ae
commit
c31078339b
@ -170,9 +170,14 @@ class GooglePrivmsgRegexp(callbacks.PrivmsgRegexp):
|
|||||||
threaded = True
|
threaded = True
|
||||||
def googleSnarfer(self, irc, msg, match):
|
def googleSnarfer(self, irc, msg, match):
|
||||||
r"^google\s+(.*)$"
|
r"^google\s+(.*)$"
|
||||||
data = google.doGoogleSearch(match.group(1), safeSearch=1)
|
searchString = match.group(1)
|
||||||
url = data.results[0].URL
|
data = google.doGoogleSearch(searchString, safeSearch=1)
|
||||||
irc.queueMsg(ircmsgs.privmsg(ircutils.replyTo(msg), url))
|
if data.results:
|
||||||
|
url = data.results[0].URL
|
||||||
|
irc.queueMsg(ircmsgs.privmsg(ircutils.replyTo(msg), url))
|
||||||
|
else:
|
||||||
|
irc.queueMsg(ircmsgs.privmsg(ircutils.replyTo(msg),
|
||||||
|
'No results for "%s"' % searchString))
|
||||||
|
|
||||||
_ggThread = re.compile(r'<br>Subject: ([^<]+)<br>')
|
_ggThread = re.compile(r'<br>Subject: ([^<]+)<br>')
|
||||||
_ggGroup = re.compile(r'Newsgroups: <a[^>]+>([^<]+)</a>')
|
_ggGroup = re.compile(r'Newsgroups: <a[^>]+>([^<]+)</a>')
|
||||||
|
Loading…
Reference in New Issue
Block a user