Permalink
Browse files

Adding in support for the datetime stamps

  • Loading branch information...
1 parent 45a946d commit b24b5dbd77ff38ad9b0a34727d1877e7070736eb @mikeal committed Oct 11, 2009
Showing with 9 additions and 6 deletions.
  1. +3 −0 couchcast/__init__.py
  2. +3 −3 couchcast/templates/itunes.mko
  3. +3 −3 couchcast/templates/rss.mko
View
@@ -1,6 +1,7 @@
import os, sys
from datetime import datetime
+import iso8601
from couchquery import Database
from webenv import HtmlResponse
from webenv.rest import RestApplication
@@ -60,6 +61,8 @@ def GET(self, request, collection):
(item._attachments[i], i,) for i in item._attachments.keys() if
item._attachments[i].get('content_type') == 'audio/mpeg'][0]
item.attachment['uri'] = self.db.uri+item['_id']+'/'+item.attachment['filename']
+ item.pubdt = iso8601.parse_date(item.couchcast_pubdatetime)
+
podcast = {'title':self.title, 'description':self.description, 'site_link':self.site_link,
'author':self.author, 'author_email':self.author_email, 'explicit':self.explicit,
'tags':self.tags, 'items':items,
@@ -5,8 +5,8 @@
<link>${podcast['site_link']}</link>
<description>${podcast['description']}</description>
<language>en</language>
- <pubDate>Sun, 11 Oct 2009 11:22:45 -0700</pubDate>
- <lastBuildDate>Sun, 11 Oct 2009 11:22:45 -0700</lastBuildDate>
+ <pubDate>${podcast['items'][-1]['couchcast_pubdatetime']}</pubDate>
+ <lastBuildDate>${podcast['items'][0]['couchcast_pubdatetime']}</lastBuildDate>
<itunes:author>${podcast['author']}</itunes:author>
% if podcast['explicit']:
<itunes:explicit>yes</itunes:explicit>
@@ -29,7 +29,7 @@
<link>${item['article_link']}</link>
% endif
<description><![CDATA[${item['description']}]]></description>
- <pubDate>Sun, 11 Oct 2009 11:22:12 -0700</pubDate>
+ <pubDate>${item['couchcast_pubdatetime']}</pubDate>
<enclosure url="${item['attachment']['uri']}" length="${item['attachment']['length']}" type="${item['attachment']['content_type']}"/>
<guid isPermaLink="false">${item['title']}</guid>
<itunes:author>${podcast['author']}</itunes:author>
@@ -5,16 +5,16 @@
<link>${podcast['site_link']}</link>
<description>${podcast['description']}</description>
<language>en</language>
- <pubDate>Sun, 11 Oct 2009 11:46:12 -0700</pubDate>
- <lastBuildDate>Sun, 11 Oct 2009 11:46:12 -0700</lastBuildDate>
+ <pubDate>${podcast['items'][-1]['couchcast_pubdatetime']}</pubDate>
+ <lastBuildDate>${podcast['items'][0]['couchcast_pubdatetime']}</lastBuildDate>
% for item in podcast['items']:
<item>
<title>${item['title']}</title>
% if 'article_link' in item:
<link>${item['article_link']}</link>
% endif
<description><![CDATA[${item['description']}]]></description>
- <pubDate>Sun, 11 Oct 2009 11:22:12 -0700</pubDate>
+ <pubDate>${item['couchcast_pubdatetime']}</pubDate>
<enclosure url="${item['attachment']['uri']}" length="${item['attachment']['length']}" type="${item['attachment']['content_type']}"/>
<guid isPermaLink="false">${item['title']}</guid>
</item>

0 comments on commit b24b5db

Please sign in to comment.