|
|
|
|
@ -88,7 +88,7 @@ def quote(msg,args): |
|
|
|
|
con = urllib2.urlopen( req ) |
|
|
|
|
|
|
|
|
|
data=con.read() |
|
|
|
|
print "data:", args[1][0:2], args[2],url |
|
|
|
|
print "data:", args[1][0:2], args[2],"->",search_results[0],url |
|
|
|
|
wqp=WikiQuoteParser() |
|
|
|
|
wqp.feed(data) |
|
|
|
|
#for i in wqp.quotes: |
|
|
|
|
@ -98,7 +98,7 @@ def quote(msg,args): |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,'Quoting "'+ search_results[0] +'"') |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,wqp.quotes[randint(0,len(wqp.quotes)-1)],'groupchat') |
|
|
|
|
else: |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,'Could not crawl quotes from "'+url+'"','groupchat') |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,'Could not crawl quotes from > '+url+' <','groupchat') |
|
|
|
|
con.close() |
|
|
|
|
except exceptions.Exception as e: |
|
|
|
|
brathuhn.sendMsg(brathuhn.ROOM,"Network Error "+unicode(e),'groupchat') |
|
|
|
|
|