-
Notifications
You must be signed in to change notification settings - Fork 986
Aww #316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Aww #316
Conversation
modules/src/aww.py
Outdated
def process(input, entities): | ||
output = {} | ||
|
||
request = urllib2.Request('https://www.reddit.com/r/aww/top.json?count=N&after=t3_XXXXX', None, headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use reddit's python library here?
I had no idea praw existed, great suggestion! |
modules/src/aww.py
Outdated
data = urllib2.urlopen(request) | ||
json_data = json.load(data) | ||
reddit = praw.Reddit(client_id='hidrsV8C-QzMmQ', | ||
client_secret='segvJkUHCUFquxCxqz5ml9-tlmE', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I've put some thought into how to handle the secret, the Reddit bot is temporary and can be spun up again. I figured you would want to generate the secret yourself since you handle deployments.
What should I do from here? Would you hold the secret in a system variable that is accessed during production?
@vinceiv Yes, praw is awesome. Contributing to open-source is indeed a great way to learn! 😄 |
Aww module supplies a response of a random image pulled from r/aww in the HOT category.
User should be able to prompt module with such language: