From 3c776d55b0cab56f94cb02c1284b945fc3ba8e45 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Mon, 1 Aug 2022 12:04:53 -0600 Subject: [PATCH] Auto update bibliogram instances w/ instance api Closes #57 --- .github/workflows/update-instances.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml index c77c551..69dcea4 100644 --- a/.github/workflows/update-instances.yml +++ b/.github/workflows/update-instances.yml @@ -48,7 +48,7 @@ jobs: done <$file # Remove any trailing commas from new instance lists - sed -i '' -e ':begin' -e '$!N' -e 's/,\n]/\n]/g' -e 'tbegin' -e 'P' -e 'D' out.json + sed -e ':begin' -e '$!N' -e 's/,\n]/\n]/g' -e 'tbegin' -e 'P' -e 'D' out.json cat out.json | jq --indent 2 . > services.json rm -f out.json @@ -62,6 +62,22 @@ jobs: git remote set-url origin git@github.com:benbusby/farside.git git checkout main + # ============================================================== + # Bibliogram update + # ============================================================== + curl -s https://bibliogram.art/api/instances | \ + jq '[ + .data | + .[] | + select(.onion_site | not) | + .address + ] | sort' > bibliogram-tmp.json + jq --slurpfile bibliogram bibliogram-tmp.json \ + '( .[] | select(.type == "bibliogram") ) + .instances |= $bibliogram[0]' services-full.json > services-tmp.json + + apply_update + # ============================================================== # searx update # ==============================================================