home · contact · privacy
Simplify quote line counting.
[plomlombot-irc.git] / plomlombot.py
index 089fa6f61997fabdfd7ba8bfe84a7d512960be25..4befc396de3539871b95c1442bcbfd77b9e259b4 100755 (executable)
@@ -122,7 +122,7 @@ def lineparser_loop(io, nickname):
                     continue
                 title = bs4.BeautifulSoup(r.text).title
                 if title:
-                    notice("PAGE TITLE FOR URL: " + title.string.strip())
+                    notice("PAGE TITLE: " + title.string.strip())
                 else:
                     notice("PAGE HAS NO TITLE TAG")
 
@@ -151,8 +151,9 @@ def lineparser_loop(io, nickname):
                 quotesfile = open(quotesfile_name, "r")
                 lines = quotesfile.readlines()
                 quotesfile.close()
-                i = random.randrange(len(lines) - 1) + 1
-                notice("QUOTE #" + str(i) + ": " + lines[i])
+                lines = lines[1:]
+                i = random.randrange(len(lines))
+                notice("QUOTE #" + str(i + 1) + ": " + lines[i])
 
         sender = ""
         for rune in tokens[0]: