Merge branch 'master' of ssh://bbl/home/cmdln/git/feeds
This commit is contained in:
commit
5cb4a62bcc
1 changed files with 6 additions and 4 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue