Fixed feed date.

This commit is contained in:
Thomas Gideon 2010-09-22 21:33:04 -04:00
parent 332de046a8
commit b96aef7e16

View file

@ -7,6 +7,7 @@ import logging
import re import re
from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulSoup
import shutil import shutil
import time
base_urls = { 'itunes' : 'http://traffic.libsyn.com/cmdln', base_urls = { 'itunes' : 'http://traffic.libsyn.com/cmdln',
'other' : 'http://cmdln.evenflow.nl/mp3' } 'other' : 'http://cmdln.evenflow.nl/mp3' }
@ -36,14 +37,15 @@ def __append(feed, suffix, append_fn, args=None):
o = open(filename, 'w') o = open(filename, 'w')
firstItem = False firstItem = False
try: try:
updated = time.strftime('%a, %d %b %Y %X +0000', feed.updated)
for line in f: for line in f:
if line.find('<item>') != -1 and not firstItem: if line.find('<item>') != -1 and not firstItem:
append_fn(entry, o, suffix, args) append_fn(entry, o, suffix, args)
firstItem = True firstItem = True
if line.startswith(' <pubDate>'): if line.startswith(' <pubDate>'):
line = ' <pubDate>%s</pubDate>' % feed.date line = ' <pubDate>%s</pubDate>\n' % updated
if line.startswith(' <lastBuildDate>'): if line.startswith(' <lastBuildDate>'):
line = ' <lastBuildDate>%s</lastBuildDate>' % feed.date line = ' <lastBuildDate>%s</lastBuildDate>\n' % updated
o.write(line) o.write(line)
finally: finally:
f.close() f.close()