aboutsummaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rwxr-xr-xextra/container_count_update/update_prod.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/extra/container_count_update/update_prod.sh b/extra/container_count_update/update_prod.sh
new file mode 100755
index 00000000..766398f2
--- /dev/null
+++ b/extra/container_count_update/update_prod.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+export CONTAINER_INDEX=fatcat_container_v05_20220110
+
+fatcat-cli search container --index-json --limit 0 state:active \
+ | jq .ident -r \
+ | pv -l \
+ > container_idents.tsv
+
+cat container_idents.tsv \
+ | parallel -j10 curl --fail -s 'https://fatcat.wiki/container/{}/stats.json' \
+ | jq -c . \
+ | pv -l \
+ > container_stats.json
+
+cat container_stats.json \
+ | jq '{ ident: .ident, releases_total: .total, preservation_bright: .preservation.bright, preservation_dark: .preservation.dark, preservation_shadows_only: .preservation.shadows_only, preservation_none: .preservation.none }' -c \
+ | esbulk -verbose -index $CONTAINER_INDEX -optype update -id ident