Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Aww #316

wants to merge 3 commits into from

Conversation

vinceiv
Copy link

@vinceiv vinceiv commented Oct 18, 2017

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:

  • "Show me something cute"
  • "r/aww"
  • "aww"

def process(input, entities):
output = {}

request = urllib2.Request('https://www.reddit.com/r/aww/top.json?count=N&after=t3_XXXXX', None, headers)
Copy link
Owner

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?

@vinceiv
Copy link
Author

vinceiv commented Oct 19, 2017

I had no idea praw existed, great suggestion!
Switched to praw in most recent commit.

data = urllib2.urlopen(request)
json_data = json.load(data)
reddit = praw.Reddit(client_id='hidrsV8C-QzMmQ',
client_secret='segvJkUHCUFquxCxqz5ml9-tlmE',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

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?

@swapagarwal
Copy link
Owner

@vinceiv Yes, praw is awesome. Contributing to open-source is indeed a great way to learn! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants