Auto update whoogle instances from CI

This commit is contained in:
Ben Busby 2021-12-23 17:33:44 -07:00
parent 6db5b40811
commit 719beb90df
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1

View File

@ -64,9 +64,9 @@ jobs:
# ==============================================================
# Simply Translate update
# ==============================================================
curl -s https://simple-web.org/instances/simplytranslate | sort > st-out
curl -s https://simple-web.org/instances/simplytranslate > st-out
sed -i -e 's/^/https:\/\//' st-out
jq -ncR '[inputs]' <<< "$(cat st-out)" > st-tmp.json
jq -ncR '[inputs]' <<< "$(cat st-out | sort)" > st-tmp.json
jq --slurpfile simplytranslate st-tmp.json \
'( .[] | select(.type == "simplytranslate") )
@ -74,6 +74,18 @@ jobs:
apply_update
# ==============================================================
# Whoogle update
# ==============================================================
curl -s https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt > whoogle-out
jq -ncR '[inputs]' <<< "$(cat whoogle-out | sort)" > whoogle-tmp.json
jq --slurpfile whoogle whoogle-tmp.json \
'( .[] | select(.type == "whoogle") )
.instances |= $whoogle[0]' services.json > services-tmp.json
apply_update
# ==============================================================
# TODO: Update instances for other services
# ==============================================================