Added #id to lasturl.

This commit is contained in:
Jeremy Fincher 2003-09-08 19:44:09 +00:00
parent 61a0142265
commit 0c3e75b282

View File

@ -257,7 +257,7 @@ class URLSnarfer(callbacks.Privmsg, ChannelDBHandler):
db = self.getDb(channel) db = self.getDb(channel)
cursor = db.cursor() cursor = db.cursor()
criterion = ' AND '.join(criteria) criterion = ' AND '.join(criteria)
sql = """SELECT url, added, added_by sql = """SELECT id, url, added, added_by
FROM urls FROM urls
WHERE %s ORDER BY id DESC WHERE %s ORDER BY id DESC
LIMIT 100""" % criterion LIMIT 100""" % criterion
@ -266,15 +266,16 @@ class URLSnarfer(callbacks.Privmsg, ChannelDBHandler):
irc.reply(msg, 'No URLs matched that criteria.') irc.reply(msg, 'No URLs matched that criteria.')
else: else:
if nolimit: if nolimit:
urls = ['<%s>' % t[0] for t in cursor.fetchall()] urls = ['<%s>' % t[1] for t in cursor.fetchall()]
s = ', '.join(urls) s = ', '.join(urls)
elif simple: elif simple:
s = cursor.fetchone()[0] s = cursor.fetchone()[0]
else: else:
(url, added, added_by) = cursor.fetchone() (id, url, added, added_by) = cursor.fetchone()
timestamp = time.strftime('%I:%M %p, %B %d, %Y', timestamp = time.strftime('%I:%M %p, %B %d, %Y',
time.localtime(int(added))) time.localtime(int(added)))
s = '<%s>, added by %s at %s.' % (url, added_by, timestamp) s = '#%s: <%s>, added by %s at %s.' % \
(id, url, added_by, timestamp)
irc.reply(msg, s) irc.reply(msg, s)