mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 22:24:20 +01:00
Changed format of rssinfo command.
This commit is contained in:
parent
747d48c7ab
commit
43ae9188b5
@ -57,6 +57,7 @@ import operator
|
|||||||
|
|
||||||
import rssparser
|
import rssparser
|
||||||
|
|
||||||
|
import utils
|
||||||
import privmsgs
|
import privmsgs
|
||||||
import callbacks
|
import callbacks
|
||||||
|
|
||||||
@ -138,16 +139,18 @@ class RSS(callbacks.Privmsg):
|
|||||||
irc.error(msg, 'Error grabbing RSS feed')
|
irc.error(msg, 'Error grabbing RSS feed')
|
||||||
return
|
return
|
||||||
# check the 'modified' key, if it's there, convert it here first
|
# check the 'modified' key, if it's there, convert it here first
|
||||||
if feed.get('modified'):
|
if 'modified' in feed:
|
||||||
date = time.asctime(feed['modified'])
|
seconds = time.mktime(feed['modified'])
|
||||||
|
when = utils.timeElapsed(time.time(), seconds) + ' ago'
|
||||||
else:
|
else:
|
||||||
date = "unavailable"
|
when = "time unavailable"
|
||||||
# The rest of the entries are all available in the channel key
|
# The rest of the entries are all available in the channel key
|
||||||
response = "Title: %s; URL: %s; Description: %s; Last updated: %s" % (
|
response = 'Title: %s; URL: <%s>; ' \
|
||||||
|
'Description: %s; Last updated %s.' % (
|
||||||
info.get('title', 'unavailable').strip(),
|
info.get('title', 'unavailable').strip(),
|
||||||
info.get('link', 'unavailable').strip(),
|
info.get('link', 'unavailable').strip(),
|
||||||
info.get('description', 'unavailable').strip(),
|
info.get('description', 'unavailable').strip(),
|
||||||
date)
|
when)
|
||||||
irc.reply(msg, ' '.join(response.split()))
|
irc.reply(msg, ' '.join(response.split()))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user