Skip to content

Instantly share code, notes, and snippets.

@sq3
Last active January 20, 2017 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sq3/24434da6a1ddc924f8491b750fc43397 to your computer and use it in GitHub Desktop.
Save sq3/24434da6a1ddc924f8491b750fc43397 to your computer and use it in GitHub Desktop.
Get .iso URL of the latest ArchLinux release
#!/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