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

Tweepy example #3

Closed
ghost opened this issue Jul 12, 2011 · 7 comments
Closed

Tweepy example #3

ghost opened this issue Jul 12, 2011 · 7 comments

Comments

@ghost
Copy link

ghost commented Jul 12, 2011

Hi,

thanks for your example on using tweepy for mining Twitter.

I installed tweepy (version 1.7.1), copied your code and inserted the details I got from Twitter.

However, I get the following error message on debugging:

Traceback (most recent call last):
File "C:\Programming\Scripts\test.py", line 65, in
streaming_api = tweepy.streaming.Stream(auth, CustomStreamListener(), timeout=60)
TypeError: init() takes at least 4 arguments (4 given)

Do you have experienced the same issue?

Thanks for your help,
majom

@paredespablo
Copy link

I have the same problem with tweepy 1.7.1

It works with basic authentication:
streaming_api = tweepy.streaming.Stream(username, password, CustomStreamListener(), timeout=60)

but refuses oauth:
streaming_api = tweepy.streaming.Stream(auth, CustomStreamListener(), timeout=60)

@ghost
Copy link
Author

ghost commented Jul 19, 2011

You're right. Basic authentication works. Thanks!

However, have I missed any requirement to get oauth work?

@ptwobrussell
Copy link
Owner

I'm really sorry that I didn't respond to this issue sooner. It slipped through the cracks. I've tested this with tweepy 1.7.1 (as verified by

import tweepy
print tweepy.__version__

and it runs as expected. Could you possibly verify your version of tweepy as shown above and make sure that you have the latest code? I'd really like to help get this cleared up, and that would be a very valuable data point for me.e

@morpheme
Copy link

Hi,

I am experiencing the same problem with oauth, although I haven't tried basic yet. I get the TypeError message mentioned above. I just issued pip install tweepy about an hour ago and so I do have 1.7.1. I have tried giving an extra argument, such as snooze_time, but that doesn't seem to affect anything.

Has there been any progress on this? Let me know if I can provide any more data for you - although I am a github newbie, so be forewarned!

Thanks for any help!

@morpheme
Copy link

Also, as long as I am showing my confusion/ignorance -- it's not clear to me how to expose the tab-delimited table that is created in the custom listener. Having ended up with a streaming API via basic auth but otherwise following the sample code, I want to do something like:

tweets = streaming_api.sample()
for t in tweets:
if t.get('text'):
print(t['text'])

but tweets isn't iterable. I realize this is almost certainly a dumb question - sorry :/

@fadmaa
Copy link

fadmaa commented Oct 25, 2011

I had the same problem. installing from git seems to solve it

setuptools - from Git repository

git clone git://github.com/tweepy/tweepy.git
cd tweepy
python setup.py install (run as admin/root)

https://github.com/tweepy/tweepy/blob/master/INSTALL

@ptwobrussell
Copy link
Owner

Thanks a lot, fadmaa. I was having a little bit of time reproducing this problem - probably because there was a regression in Tweepy somewhere along the line, but I'd been installing the latest from Git and not thinking to explicitly recommend that others do the same.

FWIW, everyone should note that you can also install directly from HEAD (or a particular revision) using pip like so:

pip install -e git+git://github.com/tweepy/tweepy.git#egg=tweepy-latest

Variations also exist that allow you to apply @revisions, etc. to install specific commits from GitHub.

Note that pip itself can be easy_installed via the standard "easy_install pip"

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

4 participants