-
-
Save jacobian/1302487 to your computer and use it in GitHub Desktop.
PyCon random review script
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
""" | |
Review you some talks! | |
Usage: | |
First:: | |
$ pip install lxml | |
$ pip install -e git://github.com/jacobian/remotetable.git#egg=remotetable | |
Then log into us.pycon.org and enter in your session ID below. | |
Then ``python randomreviews.py`` and go to town. | |
""" | |
import remotetable | |
import random | |
import webbrowser | |
# Log in, then replace this with the value of your sessionid cookie. | |
SESSION_ID = 'XXX' | |
talks = remotetable.open('http://us.pycon.org/2012/review/list/', | |
request_cookies = {'sessionid': SESSION_ID}, | |
parser = 'html', | |
row_css = 'table.review-list tr', | |
column_css = 'th, td' | |
) | |
unreviewed = [talk for talk in talks if talk['Rated'] == 'No'] | |
random.shuffle(unreviewed) | |
while True: | |
next = unreviewed.pop() | |
print "Next up: #%s: %s" % (next['#'], next['Title'].split('\n')[0]) | |
action = raw_input("Hit enter to review, 's' to skip, anything else to quit: ") | |
if action == '': | |
webbrowser.open('http://us.pycon.org/2012/review/%s/' % int(next['#'])) | |
elif action.lower() == 's': | |
continue | |
else: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment