[gimp-web/testing] WIP Python script for mirror url parsing



commit 4a075583ba7c06ce4f1cb651836e308ee6cc0638
Author: Michael Schumacher <schumaml gmx de>
Date:   Sun May 14 19:17:27 2017 +0200

    WIP Python script for mirror url parsing
    
    Future goals are mirror pinging, check for HTTPS support, file verification

 tools/downloads/mirrors-extract-urls.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/tools/downloads/mirrors-extract-urls.py b/tools/downloads/mirrors-extract-urls.py
new file mode 100755
index 0000000..5ffd2b9
--- /dev/null
+++ b/tools/downloads/mirrors-extract-urls.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*- #
+
+import json
+import urllib
+import urlparse
+from collections import OrderedDict
+
+with open('../../content/downloads/mirrors2.json') as data:
+    MIRRORS = json.load(data, object_pairs_hook=OrderedDict)
+
+    for mirror, urls in MIRRORS.iteritems() :
+        for url in urls:
+            u = urlparse.urlparse(url)
+            print u.scheme + '\t: ' +  u.hostname
+
+    


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]