Skip to content
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

Add OAuth support; update README #17

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

Conversation

andrewalexander
Copy link

I hadn't pulled in your last 10 commits, but I wanted you to see this PR so you know what I am talking about (a la Linus Torvalds' quote: "Talk is cheap. Show me the code").

@andrewalexander
Copy link
Author

I haven't tested that last commit - I didn't realize the PIL module actually got added in. When I originally forked it, the PIL module was imported, but not used anywhere. I see you added that create_spritesheet() function and it uses that library there. It was really only a few lines, so I am fairly confident it will work; the important piece was the authenticate.py (imo)

I was contemplating adding a Flask microserver that spins up, handles that initial auth, and then spins down. Pretty much like the example on the PRAW docs.

@Andygmb
Copy link
Owner

Andygmb commented Jul 13, 2015

PIL has always been used for creating the spritesheet, but that's not super important.

I had a look at the reddit oauth docs on sunday and decided to postpone working on the oauth implementation myself untill next weekend - i'm wondering why it would be necessary to run flask in the first place? Surely the requests module would suffice, or is there something about getting the oauth tokens i'm not aware of yet? (I still need to get a better understanding of the oauth setup for a script like this)

@andrewalexander
Copy link
Author

Short answer is you don't - This manual process works just fine because the web browser redirects to the response_url that was passed as part of the initial handshake process. I am not sure of a way around manually clicking allow in the browser.

I can type up a longer answer, but I think the README and the linked URLs would do a better job than I at explaining the process.

@Andygmb
Copy link
Owner

Andygmb commented Jul 13, 2015

Cool, i'll merge this PR with a develop branch for now until password auth is no longer working, or when we can figure out an automated way to get the tokens.

Have you seen into any praw extensions to handle the oauth login? I saw a couple on sunday but none that look particularly stable.

@Andygmb
Copy link
Owner

Andygmb commented Jul 13, 2015

9eb648d

Merged into oauth-dev on the main repository for now, when we get oauth working as automated as we possibly can (hopefully it'll require no user input), i'll merge into master.

@andrewalexander
Copy link
Author

Did you use pip or homebrew to install PIL?

@Andygmb
Copy link
Owner

Andygmb commented Jul 13, 2015

It actually uses Pillow, a fork of PIL, my bad.

http://pillow.readthedocs.org/installation.html

pip install Pillow should sort it out - This is why I should really sort out the installation section a bit better, and perhaps check for those modules in the setup.py. #20

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

Successfully merging this pull request may close these issues.

2 participants