diff options
author | Rob Austein <sra@hactrn.net> | 2021-10-10 19:28:31 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2021-10-10 19:28:31 -0400 |
commit | e51eac175bad30e1bfeaa172436195ef555e9884 (patch) | |
tree | b34f3ee6ff67f5638bd953b749abe59599d8fe94 /https-what-repos.py | |
parent | 31ef459ab6a4ff627850bdda19564b2a566eca15 (diff) |
page that doesn't exist anymore.
Diffstat (limited to 'https-what-repos.py')
-rwxr-xr-x | https-what-repos.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/https-what-repos.py b/https-what-repos.py index 9237f76..f74d2f8 100755 --- a/https-what-repos.py +++ b/https-what-repos.py @@ -1,14 +1,23 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -# List Cryptech git repository URLs by scraping them from the -# automatically generated Trac page. Yes, we know too much about how -# the generation script and Trac format this page, c'est la vie. +# List Cryptech git repository URLs by extracting URLs from the +# Alpha release engineering repository's .gitmodules file. -from urllib import urlopen -from xml.etree.ElementTree import ElementTree +import urllib.request +from configparser import ConfigParser, DEFAULTSECT -url = "https://wiki.cryptech.is/wiki/GitRepositories" +url = "https://git.cryptech.is/releng/alpha/plain/.gitmodules" +cfg = ConfigParser(interpolation = None) +cfg.read_string(urllib.request.urlopen(url).read().decode()) + +urls = [ + cfg[section]["url"] + for section in cfg + if section != DEFAULTSECT +] + +urls.sort() + +for url in urls: + print(url) -for x in ElementTree(file = urlopen(url)).iter("{http://www.w3.org/1999/xhtml}code"): - if x.text.startswith("https://git.cryptech.is/") and x.text.endswith(".git"): - print(x.text) |