9 atom_template = textwrap.dedent("""\
10 <?xml version="1.0" encoding="utf-8"?>
11 <feed xmlns="http://www.w3.org/2005/Atom">
12 <title>youtube-dl releases</title>
13 <id>https://yt-dl.org/feed/youtube-dl-updates-feed</id>
14 <updated>@TIMESTAMP@</updated>
18 entry_template = textwrap.dedent("""
20 <id>https://yt-dl.org/feed/youtube-dl-updates-feed/youtube-dl-@VERSION@</id>
21 <title>New version @VERSION@</title>
22 <link href="http://rg3.github.io/youtube-dl" />
23 <content type="xhtml">
24 <div xmlns="http://www.w3.org/1999/xhtml">
25 Downloads available at <a href="https://yt-dl.org/downloads/@VERSION@/">https://yt-dl.org/downloads/@VERSION@/</a>
29 <name>The youtube-dl maintainers</name>
31 <updated>@TIMESTAMP@</updated>
35 now = datetime.datetime.now()
36 now_iso = now.isoformat() + 'Z'
38 atom_template = atom_template.replace('@TIMESTAMP@', now_iso)
40 versions_info = json.load(open('update/versions.json'))
41 versions = list(versions_info['versions'].keys())
46 entry = entry_template.replace('@TIMESTAMP@', v.replace('.', '-') + 'T00:00:00Z')
47 entry = entry.replace('@VERSION@', v)
50 entries_str = textwrap.indent(''.join(entries), '\t')
51 atom_template = atom_template.replace('@ENTRIES@', entries_str)
53 with io.open('update/releases.atom', 'w', encoding='utf-8') as atom_file:
54 atom_file.write(atom_template)