Last active
July 5, 2016 19:07
-
-
Save whutch/418cd6a7d8048b3ec2bcdc13a59133c6 to your computer and use it in GitHub Desktop.
Command line roller for https://github.com/PurelyApplied/roll_one_for_me
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
""" | |
Install: | |
sudo pip install praw | |
git clone https://github.com/PurelyApplied/roll_one_for_me | |
cd roll_one_for_me | |
wget https://gist.githubusercontent.com/whutch/418cd6a7d8048b3ec2bcdc13a59133c6/raw/roll.py | |
Example usage: | |
python roll.py https://www.reddit.com/r/BehindTheTables/comments/4pxgzh/villains/ | |
""" | |
import sys | |
import praw | |
from roll_one import TableSource | |
USER_AGENT = "Generate an outcome for random tables, under the name " \ | |
"/u/roll_one_for_me Written and maintained by /u/PurelyApplied" | |
reddit = praw.Reddit(user_agent=USER_AGENT) | |
link = sys.argv[1] | |
submission = reddit.get_submission(link) | |
table = TableSource(submission, submission.title) | |
results = table.roll() | |
print(results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment