Created
February 15, 2014 18:52
-
-
Save oinopion/9023517 to your computer and use it in GitHub Desktop.
Random PR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
closeds = json.load(open('closed.json')) | |
opens = json.load(open('open.json')) | |
def today(pr): | |
return pr['created_at'].startswith('2014-02-15') | |
prs = [p for p in (opens+closeds) if today(p)] | |
winner = random.choice(prs) | |
print winner['id'], winner['user']['login'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment