diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 04:39:17 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 04:39:17 -0300 |
commit | b878c56002c5777dcbf6d713b0002aead5169286 (patch) | |
tree | 63d81edf3a21bd76f78f872709f6da5ce5aae582 /extra/lukeshu-xbs/db-pick-mirror | |
parent | e1f1ba1883d5cd76f0a1de7ce0c39af971bf79bb (diff) |
remove more duplicated files
Diffstat (limited to 'extra/lukeshu-xbs/db-pick-mirror')
-rwxr-xr-x | extra/lukeshu-xbs/db-pick-mirror | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/extra/lukeshu-xbs/db-pick-mirror b/extra/lukeshu-xbs/db-pick-mirror deleted file mode 100755 index 9474ed7..0000000 --- a/extra/lukeshu-xbs/db-pick-mirror +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env ruby - -require 'json' -require 'rest_client' - -protocol = ARGV[0] -jsonurl = ARGV[1] - -data = JSON::parse(RestClient.get(jsonurl)) - -if data["version"] != 3 - print "Data format version != 3" - exit 1 -end - -urls = data["urls"] -rsync_urls = urls.select{|a| a["protocol"]==protocol} - -# By score ( (delay+speed)/completion ) -#best = rsync_urls.sort{|a,b| (a["score"] || Float::INFINITY) <=> (b["score"] || Float::INFINITY) }.first -# By delay/completion -best = rsync_urls.sort{|a,b| a["delay"]/a["completion_pct"] <=> b["delay"]/b["completion_pct"] }.first - -puts best["url"] |