home
·
contact
·
privacy
projects
/
plomlombot-irc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify quote line counting.
[plomlombot-irc.git]
/
plomlombot.py
diff --git
a/plomlombot.py
b/plomlombot.py
index 089fa6f61997fabdfd7ba8bfe84a7d512960be25..4befc396de3539871b95c1442bcbfd77b9e259b4 100755
(executable)
--- a/
plomlombot.py
+++ b/
plomlombot.py
@@
-122,7
+122,7
@@
def lineparser_loop(io, nickname):
continue
title = bs4.BeautifulSoup(r.text).title
if title:
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")
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()
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]:
sender = ""
for rune in tokens[0]: