diff options
author | 2015-04-14 13:39:50 +0200 | |
---|---|---|
committer | 2015-04-14 13:39:50 +0200 | |
commit | 1986f0f44c0ab818b5745bcf55063a1b0f44d791 (patch) | |
tree | 660072b0a1000371323e9c88e96b964efaa0c133 | |
parent | remove jay from stats (diff) | |
download | gentoo-mirrorstats-1986f0f44c0ab818b5745bcf55063a1b0f44d791.tar.gz gentoo-mirrorstats-1986f0f44c0ab818b5745bcf55063a1b0f44d791.tar.bz2 gentoo-mirrorstats-1986f0f44c0ab818b5745bcf55063a1b0f44d791.zip |
Update mirror data URIs and fetch method
-rwxr-xr-x | distfiles_mirrors/get-mirror-list-distfiles.rb | 6 | ||||
-rwxr-xr-x | rsync_mirrors/get-mirror-list-rsync.rb | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/distfiles_mirrors/get-mirror-list-distfiles.rb b/distfiles_mirrors/get-mirror-list-distfiles.rb index 1aa22ea..0794df3 100755 --- a/distfiles_mirrors/get-mirror-list-distfiles.rb +++ b/distfiles_mirrors/get-mirror-list-distfiles.rb @@ -1,8 +1,10 @@ #!/usr/bin/ruby -%w[ rexml/document net/http ].each {|lib| require lib } +MIRROR_DATA="https://api.gentoo.org/mirrors/distfiles.xml" -m = Net::HTTP.get('www.gentoo.org', '/main/en/mirrors3.xml?passthru=1') +%w[ rexml/document open-uri ].each {|lib| require lib } + +m = URI.parse(MIRROR_DATA).read x = REXML::Document.new(m) REXML::XPath.each(x, '//*/mirrorgroup[@country]') {|el| diff --git a/rsync_mirrors/get-mirror-list-rsync.rb b/rsync_mirrors/get-mirror-list-rsync.rb index 7269ece..252bfd2 100755 --- a/rsync_mirrors/get-mirror-list-rsync.rb +++ b/rsync_mirrors/get-mirror-list-rsync.rb @@ -1,8 +1,10 @@ #!/usr/bin/ruby -%w[ rexml/document net/http ].each {|lib| require lib } +MIRROR_DATA="https://api.gentoo.org/mirrors/rsync.xml" -m = Net::HTTP.get('www.gentoo.org', '/main/en/mirrors-rsync-data.xml?passthru=1') +%w[ rexml/document open-uri ].each {|lib| require lib } + +m = URI.parse(MIRROR_DATA).read x = REXML::Document.new(m) REXML::XPath.each(x, '//*/mirrorgroup[@country]') {|el| |