Last active
January 20, 2017 14:58
-
-
Save sq3/24434da6a1ddc924f8491b750fc43397 to your computer and use it in GitHub Desktop.
Get .iso URL of the latest ArchLinux release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf8 | |
import re | |
import urllib2 | |
matches = [] | |
feed_url = 'https://www.archlinux.org/feeds/release/' | |
feed = urllib2.urlopen("https://www.archlinux.org/feeds/releases/").read() | |
pattern = r"(20\d{2}\.[01-12]{2}\.[01-]{2})" | |
regex = re.compile(pattern, re.IGNORECASE) | |
for match in regex.finditer(feed): | |
matches.append(match.group(1)) | |
version = (matches[0]) | |
arch_iso_url = 'http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/iso/' + version + '/archlinux-' + version + '-dual.iso' | |
print(arch_iso_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment