mirror of https://gitlab.com/bashrc2/epicyon
Date format
parent
6826030e3e
commit
602714906a
|
@ -145,10 +145,14 @@ def getRSSfromDict(baseDir: str, newswire: {},
|
||||||
None, domainFull,
|
None, domainFull,
|
||||||
'Newswire', translate)
|
'Newswire', translate)
|
||||||
for published, fields in newswire.items():
|
for published, fields in newswire.items():
|
||||||
|
try:
|
||||||
|
pubDate = datetime.strptime(published, "%Y-%m-%dT%H:%M:%S+00:00")
|
||||||
|
except BaseException:
|
||||||
|
continue
|
||||||
rssStr += '<item>\n'
|
rssStr += '<item>\n'
|
||||||
rssStr += ' <title>' + fields[0] + '</title>\n'
|
rssStr += ' <title>' + fields[0] + '</title>\n'
|
||||||
rssStr += ' <link>' + fields[1] + '</link>\n'
|
rssStr += ' <link>' + fields[1] + '</link>\n'
|
||||||
pubDate = datetime.strptime(published, "%Y-%m-%dT%H:%M:%SZ")
|
|
||||||
rssDateStr = pubDate.strftime("%a, %d %b %Y %H:%M:%S UT")
|
rssDateStr = pubDate.strftime("%a, %d %b %Y %H:%M:%S UT")
|
||||||
rssStr += ' <pubDate>' + rssDateStr + '</pubDate>\n'
|
rssStr += ' <pubDate>' + rssDateStr + '</pubDate>\n'
|
||||||
rssStr += '</item>\n'
|
rssStr += '</item>\n'
|
||||||
|
|
Loading…
Reference in New Issue