This repository has been archived on 2020-07-28. You can view files and clone it, but cannot push or open issues or pull requests.
aruppi-jobs/aruppi-theme-warmer.sh

29 lines
831 B
Bash
Executable File

#!/bin/bash
curl_() { curl "$@"; }
mktemp_() { mktemp --tmpdir aruppi-jobs.XXXXXXXXXX "$@"; }
echo "querying themesYear..."
years_file=`mktemp_`
curl_ -s "https://aruppi.jeluchu.xyz/apis/aruppi/v2/themesYear" > "$years_file"
for year_id in `jq -r '.[][] | .id' "$years_file" 2>/dev/null`
do
themes_file=`mktemp_`
echo " querying $year_id"
curl_ -s "https://aruppi.jeluchu.xyz/apis/aruppi/v2/themesYear/$year_id" > "$themes_file"
for title in `jq -r '.[][] | .title | @base64' "$themes_file" 2>/dev/null`
do
title=`echo $title | base64 -d`
echo " querying $title"
curl_ -s "https://aruppi.jeluchu.xyz/apis/aruppi/v2/themes/$title" > /dev/null
done
rm "$themes_file"
done
rm "$years_file"
echo "finished themesYear"