Add today and update function

This commit is contained in:
poka 2022-01-02 00:01:35 +01:00
parent 97669b90af
commit e671679932
1 changed files with 9 additions and 0 deletions

View File

@ -128,6 +128,15 @@ anniversary() {
jq "$jqNewUD" <<<$jsonData 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() { print() {
jq . <<<"$jsonData" jq . <<<"$jsonData"
} }