Skip to content

Commit

Permalink
Prettify adventofcode output
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Dec 1, 2018
1 parent 4356859 commit b1c9a1e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/adventofcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
}

leaderboard = requests.get(LEADERBOARD_URL, cookies=cookies).json()
members = leaderboard['members']

table = "\nCurrent Advent of Code 2018 ranking:\n"

for member in leaderboard['members'].values():
table += "%s:\t%s\n" % (member['name'], member['local_score'])

print("```%s```" % table)
for member in sorted(members.values(), key=lambda k: k['local_score'], reverse=True):
table += '{0:<22} {1:>5}\n'.format(member['name'], member['local_score'])

print("```{}```".format(table))

0 comments on commit b1c9a1e

Please sign in to comment.