CARVIEW |
joshthecoder / tweepy
- Source
- Commits
- Network (20)
- Issues (6)
- Downloads (17)
- Wiki (2)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
-
Feature Requestx
Here's a changeset with one approach:
https://github.com/brianmichelich/tweepy/commit/5cd1b3d1ce5d760e6c4e08af353c4c1ce406b475This allows you to set a proxy_host and proxy_port on the API() and have binder.py pick them up when creating a connection.
Comments
-
Bugx
If you made a mistake in your StreamListener implementation (when a str become an unicode), Stream._run will hide this exception. The application stop silently.
Comments
Please log in to comment. -
Maybe Bugx
when installing the latest tweepy (1.5 I think) with "python setup.py install" the error that OAuthHandler does not exist keeps popping up.
This seems to be resolved if you simply copy the dist/tweepy directory into dist-packages, which seems to indicate something goes wrong with install.
Comments
Please log in to comment. -
Downloaded streamwatcher.py from tweepy-examples. Sometimes, after a day of running, it crashes with the following (I commented out lines 117->119 in stremaing.py to catch the exception):
Traceback (most recent call last):
File "webapps/siti/mex/scripts/mystreamwatcher.py", line 68, inmyfunc()
File "webapps/siti/mex/scripts/mystreamwatcher.py", line 63, in myfunc
stream.filter(followed)
File "/home/user/webapps/siti/mex/scripts/tweepy/streaming.py", line 195, in filter
self._start(async)
File "/home/user/webapps/siti/mex/scripts/tweepy/streaming.py", line 160, in _start
self._run()
File "/home/user/webapps/siti/mex/scripts/tweepy/streaming.py", line 111, in _run
self._read_loop(resp)
File "/home/user/webapps/siti/mex/scripts/tweepy/streaming.py", line 140, in _read_loop
c = resp.read(1)
File "/usr/local/lib/python2.6/httplib.py", line 517, in read
return self._read_chunked(amt)
File "/usr/local/lib/python2.6/httplib.py", line 563, in _read_chunked
raise IncompleteRead(value)
httplib.IncompleteRead
Comments
Please log in to comment. -
Maybe Bugx
Still figuring out how to reproduce this, but seeing an encoding exception from w/in tweepy (while constructing a TweepError). Sample backtrace:
[UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 141: ordinal not in range(128)] <snip/> api.create_friendship(followee_username, headers=USER_AGENT_HEADER)<snip/> File "/usr/local/lib/python2.6/dist-packages/tweepy-1.5-py2.6.egg/tweepy/binder.py", line 167, in _call raise TweepError(error_msg) File "/usr/local/lib/python2.6/dist-packages/tweepy-1.5-py2.6.egg/tweepy/error.py", line 9, in __init__ self.reason = str(reason)
Comments
Please log in to comment. -
Maybe Bugx
Since the limit for OAuth requests is currently at 350 per hour and authenticated requests don't count against the normal rate_limit_status api, there should be a way to access the OAuth limit.
The information gets send with the header of every response on an authenticated call:
x-ratelimit-class = "api_identified"
x-ratelimit-limit = The current maximum of request per hour.
x-ratelimit-remaining = The requests remaining till the reset.
x-ratelimit-reset = UNIX timestamp as seconds when the next reset will occur.I already patched this into api.py and binder.py:
https://github.com/BonsaiDen/tweepy/commit/cf0b4068e3e882498619d897d51462de91ca7e4eMay need some changes to the variable names, but besides that it should be OK I guess.
Comments
joshthecoder Fri Mar 12 16:49:23 -0800 2010 | link
Is OAuth rate limit still incorrect for the rate_limit_status api call?
According to this issue it is "fixed": https://code.google.com/p/twitter-api/issues/detail?id=1501
Hm ok seems to be fixed now, wasn't when I checked last time.
But anyways, I think saving the information from the header might still be good, since this doesn't require an extra request, it's available immediately(which cuts down startup time in my application).
So I guess the whole thing could be refactored into something like:
def rate_limit_status(self):
if self.last_rate_limit_status == None:# make api call
else:
# return the information that came with the last request
Oh and in the case that you merge it, make sure to check out the latest commit, since my editor kinda screwed up with the whitespace in the one above.
We can already provide a proxy host via the "host" parameter in the API init method.
There is not a way to provide a port though which could be easily added. I will look into providing this in the next release. Thanks!
Unless I missed something a changed host parameter would allow for a reverse proxy and I was setting up a forward proxy.
The reverse proxy worked when I sent the request to foo.com and forwarded to twitter.com. Setting a hosts on the connection as well as the request allowed the forward proxy to work. This allowed me to use a forward proxy without setting it for the python environment.