RSS:
* Displaying the last 10 entries * Added timestamp of each entry * Title now links to entry instead of blog_url
This commit is contained in:
parent
2fb6e1483d
commit
6c778b2e8b
26
blogthon.cgi
26
blogthon.cgi
@ -228,24 +228,26 @@ if feed_display == "atom":
|
|||||||
|
|
||||||
# Generate rss 2.0 feed
|
# Generate rss 2.0 feed
|
||||||
elif feed_display == "rss":
|
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")
|
document_header("rss")
|
||||||
print ' <channel>'
|
print ' <channel>'
|
||||||
print ' <title>' + blog_title + '</title>'
|
print ' <title>' + blog_title + '</title>'
|
||||||
print ' <link>' + blog_url + '</link>'
|
print ' <link>' + blog_url + '</link>'
|
||||||
print ' <description>' + blog_subtitle + '</description>'
|
print ' <description>' + blog_subtitle + '</description>'
|
||||||
# TODO: Format like: "Tue, 8 Jul 2008 2:43:19"
|
date = time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime(time.mktime(entries[0][0])))
|
||||||
#print ' <pubDate>' + date + '<pubDate>'
|
print ' <pubDate>' + date + '</pubDate>'
|
||||||
print ''
|
print ''
|
||||||
print ' <item>'
|
j = len(entries)
|
||||||
print ' <title>' + title + '</title>'
|
if j > 10: j = 10
|
||||||
print ' <link>' + blog_url + '</link>'
|
for i in xrange(0, len(entries)):
|
||||||
print ' <guid>' + title_md5sum + '</guid>'
|
title = str(entries[i][1]).replace('entries/', '', 1).replace('.' + entries_suffix, '')
|
||||||
print ' </item>'
|
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 + '?p=' + title + '</link>'
|
||||||
|
print ' <guid>' + title_md5sum + '</guid>'
|
||||||
|
print ' <pubDate>' + date + '</pubDate>'
|
||||||
|
print ' </item>'
|
||||||
print ' </channel>'
|
print ' </channel>'
|
||||||
print '</rss>'
|
print '</rss>'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user