From f676d12988cb5dcb70beab908bedf2cc84cead2f Mon Sep 17 00:00:00 2001 From: sian1468 <58017832+sian1468@users.noreply.github.com> Date: Mon, 12 Dec 2022 03:45:13 +0700 Subject: [PATCH] Add auto update instances for libreddit (#80) * Change libreddit's fallback URL to official instance's URL * Add auto update instances for libreddit --- .github/workflows/update-instances.yml | 15 +++++++++++++++ services-full.json | 2 +- services.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml index e8fc9c7..59341e1 100644 --- a/.github/workflows/update-instances.yml +++ b/.github/workflows/update-instances.yml @@ -189,6 +189,21 @@ jobs: #apply_update + # ============================================================== + # libreddit update + # ============================================================== + curl -s https://raw.githubusercontent.com/libreddit/libreddit-instances/master/instances.json | \ + jq '[ + .instances[] | + select(.url) | + .url ] | + sort' > libreddit-tmp.json + jq --slurpfile libreddit libreddit-tmp.json \ + '( .[] | select(.type == "libreddit") ) + .instances |= $libreddit[0]' services-full.json > services-tmp.json + + apply_update + # ============================================================== # TODO: Update instances for other services # ============================================================== diff --git a/services-full.json b/services-full.json index 01df54a..599cbc5 100644 --- a/services-full.json +++ b/services-full.json @@ -2,7 +2,7 @@ { "type": "libreddit", "test_url": "/r/popular", - "fallback": "https://libredd.it", + "fallback": "https://libreddit.spike.codes", "instances": [ "https://libreddit.albony.xyz", "https://libredd.it", diff --git a/services.json b/services.json index b16c930..ca38869 100644 --- a/services.json +++ b/services.json @@ -2,7 +2,7 @@ { "type": "libreddit", "test_url": "/r/popular", - "fallback": "https://libredd.it", + "fallback": "https://libreddit.spike.codes", "instances": [ "https://libredd.it", "https://libreddit.spike.codes",