@@ -13,11 +13,10 @@ import sys, string, random, time
fromircbotimportSingleServerIRCBot
fromirclibimportnm_to_n,nm_to_h,irc_lower
importbotcommon
importurllib
importlibxml2doc
importtime
frommechanizeimportBrowser
# Exclamations - wrong input
exclamations=[
"Zing!",
"Burns!",
...
...
@@ -28,7 +27,6 @@ exclamations = [
]
# Ponderings
ponderings=[
"Hi, can I have a medium lamb roast, with just potatoes.",
"Can I slurp on your Big Cock?",
...
...
@@ -41,7 +39,8 @@ class LolBot(SingleServerIRCBot):
self.channel=channel
self.nickname=nickname
self.urls=[]
self.urls={}
self.logfile=open('/tmp/lolbot.log','a')
self.helptext="Adds URLs to a list. Commands: list - prints a bunch of URLs; clear - clears the list; lol - say something funny; <url> - adds the URL to the list; help - this message."
...
...
@@ -49,6 +48,17 @@ class LolBot(SingleServerIRCBot):
self.queue.start()
self.start()
defsave_url(self,url):
try:
br=Browser()
br.open(url)
title=br.title()
exceptExceptionasex:
printex
title=''
self.urls[url]=title
returntitle
defon_nicknameinuse(self,connection,event):
self.nickname=connection.get_nickname()+"_"
connection.nick(self.nickname)
...
...
@@ -64,14 +74,20 @@ class LolBot(SingleServerIRCBot):