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

Hanging on Chapter 9: Example 8 #133

Closed
BrendonUnland opened this issue Jan 23, 2014 · 7 comments
Closed

Hanging on Chapter 9: Example 8 #133

BrendonUnland opened this issue Jan 23, 2014 · 7 comments

Comments

@BrendonUnland
Copy link

I am returning to this hobby after a hiatus. I just git pulled and got the newest updates. I was able to get a Twitter object. Also Examples 2 and 3 work.

But when I run Example 8, it prints "Filtering the public timeline for track="TWTR" but nothing is ever returned.

I did check https://dev.twitter.com/status and it says the userstream is down. Is that why I'm not getting any results?

Also, when you've been away for some time and you do a git pull, it asks you to commit changes. I don't understand this. Can you explain?

Thanks,
B

@ptwobrussell
Copy link
Owner

Brendon -

I don't think that the userstream interruption would have anything to do with your issue in using the streaming API to pull data in this case. I think it's far more likely that there just wasn't any keyword data for TWTR when you ran the query. Time of day can play a huge role, especially with stock symbols. I can't remember, but you might also try prepending a dollar sign to stock symbols. (Can't remember if Twitter does any normalization like this.) My recommendation would be to just run a query for something common that you know exists so that you see data come through and explore from there. A trending topic is always a good choice. The entry point into the streaming API docs is here - https://dev.twitter.com/docs/streaming-apis - and you may also find this link that specifies the search api syntax helpful - https://dev.twitter.com/docs/using-search

Your other question about "committing changes" has to do with how the underlying source code management system works. What's happened is that you've made changes to the IPython Notebooks by executing them and working through the exercises, so when you try to pull in more updates, git notices that changes have happened and needs to merge them. But before it can do that, it needs you to save (git commit) them. However, if you haven't saved any work that you care about, you can just as easily discard them (via a "git checkout").

You may find the GitHub for Mac or GitHub for Windows GUI clients helpful as you learn more about Git. This git tutorial has also been helpful to some others - http://git-scm.com/docs/gittutorial

I hope this helps. Let me know if there's anything else I can to do clarify anything or help you along the way.

@BrendonUnland
Copy link
Author

Matthew,

Thanks for answering so promptly! I don't know how you do that!

So I think something more is going on with my Chapter 9: Example 8. I've tried, $TWTR, $NFLX, and the old standby Bieber. Bieber should be blowing now due to his DUI arrest in Miami. I running this on 3 different computers (2 Windows/ 1 Linux) and I not getting any values returned on any of my machines. I then disconnected my LAN and tried via WI-FI hotspot. No success.

RE: Git...I thought that was occurring and did do a git commit. On my windows box it pulled up a funny window and asked for comments, but I didn't know to do after that. I will go through the tutorial.

Thanks,
Brendon

@ptwobrussell
Copy link
Owner

@BrendonUnland - You are right about the streaming API not returning anything at the moment. No queries that I try right now return any data. The code is sound and hasn't been touched in a long time, so I'm quite sure that the code itself shouldn't be the problem unless some kind of breaking API change has occurred recently that I'm not yet aware of. This same code also worked not even a week ago when I last used it. My guess is that there could actually be a service disruption, though I'll be looking deeper into the issue to see if something else could have inadvertently cropped up.

I apologize for the inconvenience, and I'll do everything I can to help get a definitive answer on this. I'm traveling today, so bear with me as I try to work the issue.

Gratefully - MAR

@ptwobrussell
Copy link
Owner

Ok, so I've figured out what's going on. The issue appears to be that the twitter package that's being used to interface with the API from Python isn't handling the streaming API over HTTPS, and Twitter just rolled out an HTTPS-only initiative within the past week. The maintainers of the package are working on a fix, and I'll do what I can to help get it sorted, pushed though, and get an update out with the new version of the twitter package once it's released.

It may be a day or two on this, so I appreciate your patience (and thanks again, for brining it up.)

References:

Looks like those pull requests are imminent, but just haven't quite happened yet.

@BrendonUnland
Copy link
Author

No worries. I really appreciate all your help! I'm excited about getting
back to it...and it look's like you added a streaming example that writes
to MongoDB! This was where I got stuck last time and overcome by events!

Brendon

On Thu, Jan 23, 2014 at 12:21 PM, Matthew A. Russell <
[email protected]> wrote:

@BrendonUnland https://github.com/BrendonUnland - You are right about
the streaming API not returning anything at the moment. No queries that I
try right now return any data. The code is sound and hasn't been touched in
a long time, so I'm quite sure that the code itself shouldn't be the
problem unless some kind of breaking API change has occurred recently that
I'm not yet aware of. This same code also worked not even a week ago when I
last used it. My guess is that there could actually be a service
disruption, though I'll be looking deeper into the issue to see if
something else could have inadvertently cropped up.

I apologize for the inconvenience, and I'll do everything I can to help
get a definitive answer on this. I'm traveling today, so bear with me as I
try to work the issue.

Gratefully - MAR


Reply to this email directly or view it on GitHubhttps://github.com//issues/133#issuecomment-33146052
.

@ptwobrussell
Copy link
Owner

@BrendonUnland -

The patches I referenced above are still shaking out, and I plan to upgrade the VM's requirements file once a new version of the twitter package is released with the patch that is ultimately adopted, but in the meanwhile, I have some instructions for you that can help you get moving along instead of waiting on this.

  • First, restart your notebook's kernel to make sure that you have a clean working session. From the menubar, click "Kernel" => "Restart"
  • Next, create a new notebook cell with the following contents, and execute the cell
%%bash
sudo pip install --upgrade git+https://github.com/adonoho/twitter.git@db751260f733ed5f7833dc4b186717934ff18ebe#egg=adonoho-pr-fix-stream-db751260f733ed5f7833dc4b186717934ff18ebe

Assuming the standard output you see from executing that cell doesn't contain any kind of error (and it shouldn't), you should not have a twitter package installed that is capable of properly interfacing with the Streaming API by adopting the patch from python-twitter-tools/twitter#196 that's referenced above.

Give this a shot, and let me know if you experience any more problems. I'd like know that you've gotten this all sorted and are in a good position to move forward. Also, please report any issues you encounter that you believe may be related to glitches with this patch. (Unexpected things like your connection breaking, etc.)

I'll update/close this ticket again once there is a final resolution to all of this, but the "workaround" above should get you to the same place.

Thanks again for your patience.

@BrendonUnland
Copy link
Author

Matthew,

I've followed your directions and everything appears to be working! I'm
receiving Bieber tweets galore!

I'll let you know if I experience any unexpected things...now it's on to
saving these tweets from the stream to MongoDB!

Thanks,
Brendon

On Mon, Jan 27, 2014 at 4:00 PM, Matthew A. Russell <
[email protected]> wrote:

@BrendonUnland https://github.com/BrendonUnland -

The patches I referenced above are still shaking out, and I plan to
upgrade the VM's requirements file once a new version of the twitter
package is released with the patch that is ultimately adopted, but in the
meanwhile, I have some instructions for you that can help you get moving
along instead of waiting on this.

First, restart your notebook's kernel to make sure that you have a
clean working session. From the menubar, click "Kernel" => "Restart"

Next, create a new notebook cell with the following contents, and
execute the cell

%%bash
sudo pip install --upgrade git+https://github.com/adonoho/twitter.git@db751260f733ed5f7833dc4b186717934ff18ebe#egg=adonoho-pr-fix-stream-db751260f733ed5f7833dc4b186717934ff18ebe

Assuming the standard output you see from executing that cell doesn't
contain any kind of error (and it shouldn't), you should not have a twitter
package installed that is capable of properly interfacing with the
Streaming API by adopting the patch from python-twitter-tools/twitter#196https://github.com/sixohsix/twitter/pull/196that's referenced above.

Give this a shot, and let me know if you experience any more problems. I'd
like know that you've gotten this all sorted and are in a good position to
move forward. Also, please report any issues you encounter that you believe
may be related to glitches with this patch. (Unexpected things like your
connection breaking, etc.)

I'll update/close this ticket again once there is a final resolution to
all of this, but the "workaround" above should get you to the same place.

Thanks again for your patience.

Reply to this email directly or view it on GitHubhttps://github.com//issues/133#issuecomment-33422088
.

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

No branches or pull requests

2 participants