Merge pull request #193 from Loyalsoldier/master

Refine ookla-speedtest hosts generation script using Perl
This commit is contained in:
Richard Chen 2020-01-28 08:13:48 +08:00 committed by GitHub
commit 6dfc13a2ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -34,10 +34,7 @@ jobs:
- name: Automatically generate ookla-speedtest sub-list from source
run: |
curl -L -o servers-source.xml "https://c.speedtest.net/speedtest-servers-static.php"
cat servers-source.xml | sed -nEe 's/.+host="(.+):[0-9]+".+/\L\1/p' | sort -u > hosts-with-ip.txt
sed -E '/^([0-9]{1,3}\.){3}[0-9]{1,3}$/d' hosts-with-ip.txt > hosts-without-ip.txt
cat hosts-without-ip.txt | awk '{printf "full:%s\n", $0}' > $GOPATH/src/$REPO_URL/data/ookla-speedtest
echo "include:ookla-speedtest-ads" >> $GOPATH/src/$REPO_URL/data/ookla-speedtest
perl -ne '/host="(.+):[0-9]+"/ && print "full:$1\n"' servers-source.xml | perl -ne 'print if not /^(full:([0-9]{1,3}\.){3}[0-9]{1,3})$/' | perl -ne 'print lc' | sort --ignore-case -u >> $GOPATH/src/$REPO_URL/data/ookla-speedtest
- name: Build geosite.dat file
run: |

View File

@ -4,7 +4,7 @@
# For more details, please visit:
# https://github.com/v2ray/domain-list-community/blob/master/.github/workflows/build.yml
#
# Or you can generate manually with following Javascript:
# Or you can generate manually with following Javascript code:
# let servers = [];
# document.querySelectorAll('server').forEach(s => {
# let v = s.attributes.host.value;
@ -27,6 +27,5 @@
# });
# console.log(output);
# Placeholder & just for demo
# Do not remove the following line
include:ookla-speedtest-ads