From 719beb90df7d573c95fea96f911f79d41c9f5fe5 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Thu, 23 Dec 2021 17:33:44 -0700 Subject: [PATCH] Auto update whoogle instances from CI --- .github/workflows/update-instances.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml index aefba6f..293e393 100644 --- a/.github/workflows/update-instances.yml +++ b/.github/workflows/update-instances.yml @@ -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 # ==============================================================