Skip to content

Instantly share code, notes, and snippets.

@oinopion
Created February 15, 2014 18:52
Show Gist options
  • Save oinopion/9023517 to your computer and use it in GitHub Desktop.
Save oinopion/9023517 to your computer and use it in GitHub Desktop.
Random PR
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