Last active
April 12, 2017 17:10
-
-
Save stanley-shi/0d99edfb034c6fe178ec to your computer and use it in GitHub Desktop.
How to get the preferred download address for an apache component
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
# this script prints the preferred apache mirror and path_info to download components; | |
import urllib | |
import json | |
url="https://www.apache.org/dyn/closer.cgi?as_json=1" | |
#url='https://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz?as_json=1' | |
result=json.load(urllib.urlopen(url)) | |
print result['preferred'] | |
print result['path_info'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment