Closed terrybleger closed 12 years ago
I can confirm this works, but is this a tweepy problem or a twitter streaming api problem?
I've been reading on this the last few days, and best I can tell, the Twitter Streaming API requires Basic Auth, not Oauth. I'd be willing to bet there is something ugly in the backend and the Streaming API will take a while to follow the rest if the Twitterverse.
Well, this is probably the best solution. But the problem is: the url is not being encoded properly - I mean, whitespaces in the urls should be replaced by "%20" but they are being replaced by "+". So I edited the steaming.py file (in my ubuntu system it is located at /usr/local/lib/python
I added: self.body = self.body.replace("+","%20") I'm noob to tweepy and python. You'll probably find better solutions.
Committed a fix for this into master branch. Should be available in Release 1.10.
So many people thought it was the urllib or httplib fault, but twitter always response 401 Unauthorized.
'i have space character' 'i+have+space+character' 'i%20have%20space%20character'
It's a total useless to escape or even unescape since it was not the urllib problem.
"" total fail if there is any space character inside track "" auth = tweepy.auth.OAuthHandler('consumer_key', 'consumer_secret') auth.set_access_token('oauth_token', 'oauth_secret')
"" works like a charm but twitter said they will eradicate this using "" auth = tweepy.auth.BasicAuthHandler('my_user', 'my_pass')
stream = Stream(auth, StreamListener()) stream.filter(follow=None, track='i have space character', async=False, locations=None, count=None)