From e671679932797ab9590e63d7dc9fa8d4ea024e73 Mon Sep 17 00:00:00 2001 From: poka Date: Sun, 2 Jan 2022 00:01:35 +0100 Subject: [PATCH] Add today and update function --- explorer.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/explorer.sh b/explorer.sh index 5ad8998..cc5ea9f 100755 --- a/explorer.sh +++ b/explorer.sh @@ -128,6 +128,15 @@ anniversary() { jq "$jqNewUD" <<<$jsonData } +today() { + todayDate=$(date +'%d-%m-%y') + jq '.[] | select(.date=="'$todayDate'")' <<<$jsonData +} + +update() { + curl -s https://g1-stats.axiom-team.fr/data/daily.json > $jsonFile && echo "Data have been updated" || echo "Error: Can't update data" +} + print() { jq . <<<"$jsonData" }