Closed S3kr3tto closed 10 years ago
Hey Hector - I'll do my best to help you, but bear with me, because this particular example can be just a little bit tricker to debug remotely than most of the others.
A few questions:
Finally, can you describe the exact flow of what happens? e.g. You run the code, you get the "busy" indicator in the notebook, you open http://0.0.0.0:5000 in a separate browser tab, and then you get a 500 Error screen immediately? (Or do you get redirected to Twitter first before that ultimately happens?)
Hi Matthew,
I understand it's a little bit trickier to debug remotely, I'll do do my best to answer your questions.
1. I'm running everything from the virtual machine.
2. Yes, I'm running it from the IPython Notebook
3. I'm using all the source code from the repo. I usually write the code and then run it, fixing any bug and stuff, because I find it easier for me to learn the code this way. But at the moment I'm using a full copy/paste of the code from the repo.
4. Only Consumer Key/Secret, for the callback URL I'm using the same that appeared in the example. And I have everything working on the Twitter App side, the key/secret, callback, everything.
This is what I'm doing:
1. Open a new IPython Notebook copy/paste Example 2 code.
2. Add the CONSUMER KEY/SECRET
3. Hit Shift and Return get the Busy indicator in the notebook and then I get this message: * Running on http://0.0.0.0:5000/
4. If I click that URL a new browser window open and I get a 404 Not Found error.
5. If I copy/paste that same URL to a browser window I get the same 404 Not Found and this message on IPython: 10.0.2.2 - - [09/Jul/2014 00:30:13] "GET / HTTP/1.1" 404 -
6. If I copy/paste the callback URL (http://127.0.0.1:5000/oauth_helper) to the browser I get the Internal Server Error... And this message in IPython: 10.0.2.2 - - [09/Jul/2014 00:32:53] "GET /oauth_helper HTTP/1.1" 500 -
That's what I'm doing, and I never get redirected to the Twitter website or anything.
Héctor M. Cruz
Thanks, that level of detail is really helpful.
One more question - is a value for callback URL specified in your application settings at https://apps.twitter.com ? If not, mind trying that? I seem to recall that specifying a localhost value for that field can cause problems.
If this suggestion doesn't work out for you, I'll need re-run this code myself tonight and see if I can reproduce the error in order to get you over this hurdle.
On Jul 8, 2014, at 7:38 PM, Héctor Cruz notifications@github.com wrote:
Hi Matthew,
I understand it's a little bit trickier to debug remotely, I'll do do my best to answer your questions.
- I'm running everything from the virtual machine.
- Yes, I'm running it from the iPython Notebook
- I'm using all the source code from the repo. I usually write the code and then run it, fixing any bug and stuff, because I find it easier for me to learn the code this way. But at the moment I'm using a full copy/paste of the code in the repo.
- Only Consumer Key/Secret, for the callback URL I'm using the same that appeared in the example. And I have everything working on the Twitter App side, the key/secret, callback, everything. This is what I'm doing:
- Open a new IPython Notebook copy/paste Example 2 code.
- Add the CONSUMER KEY/SECRET
- Hit Shift and Return get the Busy indicador in the notebook and then I get this message: * Running on http://0.0.0.0:5000/
- If I click that URL a new browser window open and I get a 404 Not Found error.
- If I copy/paste that same URL to a browser window I get the same 404 Not Found and this message on IPython: 10.0.2.2 - - [09/Jul/2014 00:30:13] "GET / HTTP/1.1" 404 -
- If I copy/paste the callback URL (http://127.0.0.1:5000/oauth_helper) to the browser I get the Internal Server Error... And this message in IPython: 10.0.2.2 - - [09/Jul/2014 00:32:53] "GET /oauth_helper HTTP/1.1" 500 - That's what I'm doing, and I never get redirected to the Twitter website or anything.
Héctor M. Cruz
— Reply to this email directly or view it on GitHub.
Hi Matthew,
In https://apps.twitter.com for callback URL I'm using this http://www.example.com/oauth_helper
But something curious happened today and I got it to work.
This is what I did:
1. Open a new IPython Notebook copy/paste Example 2 code.
2. Add the CONSUMER KEY/SECRET
3. Hit Shift and Return get the Busy indicador in the notebook and then I get this message: * Running on http://0.0.0.0:5000/
4. After step 3, I open a new browser window and copy/paste the oauth_url (http://api.twitter.com/oauth/authorize?oauth_token=) but didn't hit enter.
5. Then I when to the twitter_oauth file that was created on my chapter 9 folder, copy/paste and append the first long string on the file to the end of the oauth_url, hit enter, got redirected to the App Authorization Website, authorized it and it work. (http://api.twitter.com/oauth/authorize?oauth_token=RwDvJxRwGj7Qrvv2QV3twasHw3MutIfUCqVEscFpd8Q)
6. This is what I got in IPython: 10.0.2.2 - - [10/Jul/2014 01:20:16] "GET /oauth_helper?oauth_token=RwDvJxRwGj7Qrvv2QV3twasHw3MutIfUCqVEscFpd8Q&oauth_verifier=JR2XoDaUNZdC7Nr0D4wzMuqgMD5kvOSmMCK1IqvkH0 HTTP/1.1" 200 -
I believe there could be a problem with the reading of the twitter_oauth file.
H. Cruz
Fascinating. In any event, you are good on this for now? Let me know if there's anything else I can do to help you in the immediate timeframe. (I've added a review of this example to my TODO queue for later if you are good for now.)
Everything good for now, thanks for your help!
H. Cruz
Hi Matthew, I have a problem with Example 9.2, I have everything, Consumer Key, Consumer Secret, the callback URL properly set, but I keep getting this error everytime I run the URL (http://127.0.0.1:5000/oauth_helper).
Internal Server Error...
I have no idea what I'm doing wrong.
H. Cruz