From a324f0a371fc50d6eb03242b129a0c85fde635c4 Mon Sep 17 00:00:00 2001 From: jartigag Date: Fri, 1 Dec 2023 18:42:48 +0100 Subject: [PATCH] fix --- update_leaderboard.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update_leaderboard.sh b/update_leaderboard.sh index 5f57f76..d4994ff 100755 --- a/update_leaderboard.sh +++ b/update_leaderboard.sh @@ -16,7 +16,7 @@ EOF curl --cookie "session=$COOKIE" -XGET https://adventofcode.com/2023/leaderboard/private/view/1065002.json 2>/dev/null > leaderboard2023.json -data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2023.json | sed 's/Uri/adrian-uri/' | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') +data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2023.json | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') echo $data | jq -j '.name," ",.stars,"\n"' | \ awk 'BEGIN{ @@ -47,7 +47,7 @@ EOF curl --cookie "session=$COOKIE" -XGET https://adventofcode.com/2022/leaderboard/private/view/1065002.json 2>/dev/null > leaderboard2022.json -data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2022.json | sed 's/Uri/adrian-uri/' | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') +data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2022.json | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') echo $data | jq -j '.name," ",.stars,"\n"' | \ awk 'BEGIN{ @@ -75,7 +75,7 @@ EOF curl --cookie "session=$COOKIE" -XGET https://adventofcode.com/2021/leaderboard/private/view/1065002.json 2>/dev/null > leaderboard2021.json -data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2021.json | sed 's/Uri/adrian-uri/' | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') +data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2021.json | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') echo $data | jq -j '.name," ",.stars,"\n"' | \ awk 'BEGIN{ @@ -104,7 +104,7 @@ EOF curl --cookie "session=$COOKIE" -XGET https://adventofcode.com/2020/leaderboard/private/view/1065002.json 2>/dev/null > leaderboard2020.json -data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2020.json | sed 's/Uri/adrian-uri/' | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') +data=$(jq '.members | flatten | sort_by(.stars) | reverse | .[] | {name: .name, stars: .stars}' leaderboard2020.json | sed 's/Rubén Maté/rubenmate/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/') # fix order: data=$(echo $data | sed 's/{ "name": "lassa97", "stars": 50 } { "name": "vLabayen", "stars": 50 }/{ "name": "vLabayen", "stars": 50 } { "name": "lassa97", "stars": 50 }/')