Skip to content

Instantly share code, notes, and snippets.

@microprediction
Created July 31, 2020 16:15
Show Gist options
  • Save microprediction/39e46e13c69e165318d6471b5f68529f to your computer and use it in GitHub Desktop.
Save microprediction/39e46e13c69e165318d6471b5f68529f to your computer and use it in GitHub Desktop.
from getjson import getjson
from pprint import pprint
# Human : "I don't see who is winning what."
# Crawler: "Hold my beer ..."
def descend(d):
return {k: v for k, v in sorted(d.items(), key=lambda item: item[1], reverse=True)}
PRIZES = 'https://api.microprediction.org/prizes/'
pprint([list(zip(money, descend(getjson(url)))) for url, money in getjson(PRIZES).items()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment