diff options
Diffstat (limited to 'blogthon.cgi')
-rwxr-xr-x | blogthon.cgi | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/blogthon.cgi b/blogthon.cgi index 3ff5dab..abfaf8d 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -228,24 +228,26 @@ 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 '' - print ' <item>' - print ' <title>' + title + '</title>' - print ' <link>' + blog_url + '</link>' - print ' <guid>' + title_md5sum + '</guid>' - print ' </item>' + 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 + '?p=' + title + '</link>' + print ' <guid>' + title_md5sum + '</guid>' + print ' <pubDate>' + date + '</pubDate>' + print ' </item>' print ' </channel>' print '</rss>' |