diff --git a/aoc/main.py b/aoc/main.py index 1d1be3d..e66caa9 100644 --- a/aoc/main.py +++ b/aoc/main.py @@ -18,19 +18,20 @@ def get_leaderboard_data(): data = response.json() return data -def format_leaderboard(data, num_players=20): +def format_leaderboard(data, num_players=100): leaderboard_stats = "r/developersIndia Advent of Code Leaderboard Stats\n\n" leaderboard_stats += "| Rank | Player | Stars | Score |\n" leaderboard_stats += "|------|--------|-------|-------|\n" # Sort members by stars in descending order - sorted_members = sorted(data['members'].values(), key=lambda x: x['stars'], reverse=True) + sorted_members = sorted(data['members'].values(), key=lambda x: x['local_score'], reverse=True) # Include only the top players for i, member_data in enumerate(sorted_members[:num_players]): leaderboard_stats += f"| {i + 1} | {member_data['name']} | {member_data['stars']} | {member_data['local_score']} |\n" leaderboard_stats += f"\n[Advent of Code Leaderboard](https://adventofcode.com/2023/leaderboard/private/view/{aoc_leaderboard_code})\n" + leaderboard_stats += f"\nUpdated every 24 hours" return leaderboard_stats