If a URL has been mentioned in the recent past, then it'll be
obviously visible in-channel, and it was probably a mistake
(e.g. mentioning a URL you meant to ~twit), so no need to comment on
it.
hturlre= re.compile(r"(http)(s?://[^ ]+)( |$)")
#matches \bre\:?\s+ before a regexp; (?i)==case insensitive match
shibboleth = re.compile(r"(?i)\bre\:?\s+((?:(?:http)|(?:nsfw))s?://[^ ]+)( |$)")
hturlre= re.compile(r"(http)(s?://[^ ]+)( |$)")
#matches \bre\:?\s+ before a regexp; (?i)==case insensitive match
shibboleth = re.compile(r"(?i)\bre\:?\s+((?:(?:http)|(?:nsfw))s?://[^ ]+)( |$)")
+#How long (in s) to wait since the most recent mention before commenting
+url_repeat_time = 300
urlinfos = ["a new",
"a fascinating",
"an interesting",
urlinfos = ["a new",
"a fascinating",
"an interesting",
T=urldb[urlstring]
message="observes %s URL, first mentioned %s by %s" % \
(T.urltype(),T.firstmen(),T.nick)
T=urldb[urlstring]
message="observes %s URL, first mentioned %s by %s" % \
(T.urltype(),T.firstmen(),T.nick)
- if shibboleth.search(command)==None:
+ if shibboleth.search(command)==None and \
+ time.time() - T.lastseen > url_repeat_time:
conn.action(bot.channel, message)
T.lastseen=time.time()
T.count+=1
conn.action(bot.channel, message)
T.lastseen=time.time()
T.count+=1