From 317d4edfa896f8752a06d87304b9289a15eb4b1e Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 5 Jan 2014 05:04:46 +0100 Subject: [PATCH] Improve Atom feed creation (Fixes #2081) --- devscripts/gh-pages/update-feed.py | 43 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/devscripts/gh-pages/update-feed.py b/devscripts/gh-pages/update-feed.py index 2219418ce..3b49a56f1 100755 --- a/devscripts/gh-pages/update-feed.py +++ b/devscripts/gh-pages/update-feed.py @@ -7,45 +7,44 @@ import textwrap atom_template = textwrap.dedent("""\ - - - youtube-dl releases - https://yt-dl.org/feed/youtube-dl-updates-feed - @TIMESTAMP@ + + + youtube-dl releases + https://yt-dl.org/feed/youtube-dl-updates-feed + @TIMESTAMP@ @ENTRIES@ - """) + """) entry_template = textwrap.dedent(""" - - https://yt-dl.org/feed/youtube-dl-updates-feed/youtube-dl-@VERSION@ - New version @VERSION@ - - + + https://yt-dl.org/feed/youtube-dl-updates-feed/youtube-dl-@VERSION@ + New version @VERSION@ + + - - - The youtube-dl maintainers - - @TIMESTAMP@ - + + + The youtube-dl maintainers + + @TIMESTAMP@ + """) now = datetime.datetime.now() -now_iso = now.isoformat() +now_iso = now.isoformat() + 'Z' atom_template = atom_template.replace('@TIMESTAMP@', now_iso) -entries=[] - versions_info = json.load(open('update/versions.json')) versions = list(versions_info['versions'].keys()) versions.sort() +entries = [] for v in versions: - entry = entry_template.replace('@TIMESTAMP@',v.replace('.','-')) - entry = entry.replace('@VERSION@',v) + entry = entry_template.replace('@TIMESTAMP@', v.replace('.', '-') + 'T00:00:00Z') + entry = entry.replace('@VERSION@', v) entries.append(entry) entries_str = textwrap.indent(''.join(entries), '\t')