* Displaying the last 10 entries
* Added timestamp of each entry
* Title now links to entry instead of blog_url
This commit is contained in:
Stefan Ritter 2009-12-03 14:48:20 +01:00
parent 2fb6e1483d
commit 6c778b2e8b

View File

@ -228,23 +228,25 @@ if feed_display == "atom":
# Generate rss 2.0 feed
elif feed_display == "rss":
title = str(entries[0][1]).replace('entries/', '', 1).replace('.' + entries_suffix, '')
date = entries[0][0]
blog_title_md5sum = generate_uuid(blog_title)
title_md5sum = generate_uuid(title)
document_header("rss")
print ' <channel>'
print ' <title>' + blog_title + '</title>'
print ' <link>' + blog_url + '</link>'
print ' <description>' + blog_subtitle + '</description>'
# TODO: Format like: "Tue, 8 Jul 2008 2:43:19"
#print ' <pubDate>' + date + '<pubDate>'
date = time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime(time.mktime(entries[0][0])))
print ' <pubDate>' + date + '</pubDate>'
print ''
j = len(entries)
if j > 10: j = 10
for i in xrange(0, len(entries)):
title = str(entries[i][1]).replace('entries/', '', 1).replace('.' + entries_suffix, '')
date = time.strftime("%a, %d %b %Y %H:%M:%S %z", time.gmtime(time.mktime(entries[i][0])))
title_md5sum = generate_uuid(title)
print ' <item>'
print ' <title>' + title + '</title>'
print ' <link>' + blog_url + '</link>'
print ' <link>' + blog_url + '?p=' + title + '</link>'
print ' <guid>' + title_md5sum + '</guid>'
print ' <pubDate>' + date + '</pubDate>'
print ' </item>'
print ' </channel>'
print '</rss>'