Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jartigag committed Dec 2, 2023
1 parent f761914 commit 4ad0662
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Empty file removed anatxiki/.gitkeep
Empty file.
20 changes: 10 additions & 10 deletions update_leaderboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ 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/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/calvo111979/anatxiki/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/')

echo $data | jq -j '.name," ",.stars,"\n"' | \
awk 'BEGIN{
langs["lassa97"] ="*"
langs["vLabayen"] ="*"
langs["calvo111979"]="*"
langs["vLabayen"] ="Python"
langs["anatxiki"] ="Python"
langs["jartigag"] ="*"
langs["mariaove"] ="*"
langs["jesusarell"] ="*"
langs["i97orbegozo"]="*"
langs["rubenmate"] ="*"
langs["adrian-uri"] ="*"
langs["Adrian-uri"] ="*"
langs["clarriu97"] ="*"
}
{print" | [@"$1"](https://github.com/"$1")| ["langs[$1]"](https://github.com/TLMn00bs/advent-of-code/tree/master/"$1") | "$2" |"}' >> README.md
Expand All @@ -47,13 +47,13 @@ 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/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/calvo111979/anatxiki/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/')

echo $data | jq -j '.name," ",.stars,"\n"' | \
awk 'BEGIN{
langs["lassa97"] ="*"
langs["vLabayen"] ="Python"
langs["calvo111979"]="*"
langs["anatxiki"] ="*"
langs["jartigag"] ="*"
langs["mariaove"] ="*"
langs["jesusarell"] ="*"
Expand All @@ -75,13 +75,13 @@ 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/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/calvo111979/anatxiki/' | sed 's/Jesús Arellano/jesusarell/' | sed 's/0rb3/i97orbegozo/')

echo $data | jq -j '.name," ",.stars,"\n"' | \
awk 'BEGIN{
langs["lassa97"] ="Python (after day 3, using grinch.py to grab solutions from other people)"
langs["vLabayen"] ="Python (Rust a few days later)"
langs["calvo111979"]="Python (Rust a few days later)"
langs["anatxiki"] ="Python (Rust a few days later)"
langs["jartigag"] ="Typescript"
langs["mariaove"] ="Java"
langs["jesusarell"] ="Python"
Expand All @@ -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/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/calvo111979/anatxiki/' | 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 }/')
Expand All @@ -113,7 +113,7 @@ echo $data | jq -j '.name," ",.stars,"\n"' | \
awk 'BEGIN{
langs["lassa97"] ="Python"
langs["vLabayen"] ="Python"
langs["calvo111979"]="Python"
langs["anatxiki"] ="Python"
langs["jartigag"] ="Python"
langs["mariaove"] ="Java"
langs["jesusarell"] ="Python"
Expand Down

0 comments on commit 4ad0662

Please sign in to comment.