Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/magnet2feed.py
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-07-19 13:52:59 +0200
committerErich Eckner <git@eckner.net>2019-07-19 13:52:59 +0200
commit50f94cf3debebb079be4090bd480f485dd905b28 (patch)
tree147e976e9f8ba6fb5a670dc6f4dac2c27aca8be1 /magnet2feed.py
parent1543a116a491199b6e39e1e18b4c13b8b72fbd26 (diff)
parentf39a7ec765dc05e04b315d538634140f7f323398 (diff)
Merge branch 'al32-torrent'
Diffstat (limited to 'magnet2feed.py')
-rw-r--r--magnet2feed.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/magnet2feed.py b/magnet2feed.py
new file mode 100644
index 0000000..5dc767f
--- /dev/null
+++ b/magnet2feed.py
@@ -0,0 +1,30 @@
+from feedgenerator import Rss201rev2Feed
+import sys
+from os.path import basename
+
+feed_url = 'https://static.dopsi.ch/al32/feed_{arch}.rss'
+architectures = ['i686', 'dual']
+
+
+def main(link, date):
+ for arch in architectures:
+ feed = Rss201rev2Feed(title='ArchLinux32 torrent download feed ({arch} ISO)'.format(arch=arch),
+ link=feed_url,
+ description="A torrent feed to download the latest ArchLinux32 {arch} iso".format(
+ arch=arch
+ ),
+ language='en')
+
+ feed.add_item(title='ArchLinux32 {arch} {date}'.format(arch=arch, date=date),
+ link=link,
+ description='ArchLinux32 {arch} {date}'.format(arch=arch, date=date))
+
+ with open(basename(feed_url).format(arch=arch), mode='w') as feed_file:
+ feed.write(feed_file, 'utf-8')
+
+
+if __name__ == '__main__':
+ if len(sys.argv) != 3:
+ print('Error: {cmd} magnet date'.format(cmd=sys.argv[0]))
+
+ main(link=sys.argv[1], date=sys.argv[2])