* Removal of oauth2 lib, `requests` has fully taken over. :)
* FIXED: Obtaining auth url with specified callback was broke..
wouldn't give you auth url if you specified a callback url
* Updated requests to pass the headers that are passed in the init, so
User-Agent is once again `Twython Python Twitter Library v2.1.0`
👍 :)
* Catching exception when Stream API doesn't return valid JSON to parse
* Removed `DELETE` method. As of the Spring 2012 clean up, Twitter no
longer supports this method
* Updated `post` internal func to take files as kwarg
* `params - params or {}` only needs to be done in `_request`, just a
lot of redundant code on my part, sorry ;P
* Removed `bulkUserLookup`, there is no need for this to be a special
case, anyone can pass a string of username or user ids and chances are
if they're reading the docs and using this library they'll understand
how to use `lookupUser()` in `twitter_endpoints.py` passing params
provided in the Twitter docs
* Changed internal `oauth_secret` variable to be more consistent with
the keyword arg in the init `oauth_token_secret`
* update twitter_endpoints with isListSubscriber and isListMember
instead of having them in twython.py
* app_key and app_secret in place to take over twitter_token and
twitter_secret
* updated methods to have the short hand description show up, should
always be on first line and the description.. not repeating the function
* fixed other method docs and stuff
Addresses most changes and issues with Twitter Spring cleanup 2012. Documentation
update on methods, started move to docs in RST format. Exceptions set to eventually
be deprecated (along with search functions).
Conflicts:
twython/twython.py
* Fixed a typo - 'startwith' replaced with 'startswith'
* Got rid of constructApiUrl, it's no longer needed, self.request()
does it internally
* A bunch of odds and ends to get this to auto-merge finally?! :D
# convert any http Twitter url into https, for the sake of user security
# only convert the protocol part, not all occurences of http://, in case users want to search that
endpoint = endpoint.replace('http://','https://',1)
This is to ensure all passed Twitter urls are converted into https, without messing with the rest of the url.
So I enclosed it in a urllib.quote_plus function call.
examples:
>>> urllib.quote_plus(Twython.unicode2utf8('h ^&$'))
'h+%5E%26%24'
>>> Twython.unicode2utf8('h ^&$')
'h ^&$'
>>>
* We don't need RequestException anymore.
* I changed TwythonError to raise TwythonRateLimitError instead of
TwythonAPIError since TwythonRateLimitError is more verbose and in the
belief we should deprecate TwythonAPILimit and ultimately remove it in
2.0
* And I updated the version to 1.7.0 -- I feel like development as far
as versioning seems like it's going fast, but versioning is versioning
and I'm following Twitter's rhythm of versioning
<major>.<minor>.<bugfix>, minor changing when minor features or
significant fixes have been added. In this case, TwythonRateLimitError
should start being caught in place of TwythonAPILimit
* Updated all methods to use the internal get/post methods
* isListMember was using the deprecated *GET
:user/:list_id/members/:id* Twitter endpoint
* isListMember was also using a deprecated method
* Changed documentation on methods, the first line should be what the
method does (docstring)
* Started to change documentation for methods to use rst (restructed
text) -- What PyPi supports as well as Sphinx generator and others
instead of Markdown
* Planning to get rid of Exceptions - TwythonAPILimit, APILimit,
AuthError and Methods - searchTwitter(), searchTwitterGen()
Changed the TwythonError to stash the error_code into self, one or two raises of TwythonError didn't pass in the status code, updated them to do so. (work by @jvanasco)
I still think it's weird to have them, but I'm not against giving the
user more information. I put back in the twitter_http_status_codes
variable, but I changed where the logic was being handled, instead of
it happening the in _request, it will be asserted in Twython error if
an error_code is passed AND the error_code is in
twitter_http_status_codes
* Removed twitter_http_status_codes. Unnecessary variable when we are
giving them the error back.
* Added a "Please see..." message to TwythonError if the exception
passes an error code, linking to Twitter API error response page.
* Merged stuff from constructFunc into _request()
- added twitter's http status codes to twitter_endpoints.py ( dict index on status code, value is a tuple of name + description )
- created an internal stash called '_last_call' that stores details of the last api call ( the call, response data, headers, url, etc )
- better error handling for api issues:
- - raises an error when the status code is not 200 or 304
- - raises TwythonAPILimit when a 420 rate limit code is returned
- - raises a TwythonError on other issues, setting the correct status code and using messages that are from the twitter API
- wraps a successful read in a try/except block. there's an error i haven't been able to reproduce where invalid content can get in there, it would be nice to catch it and write a handler for it. ( the previous functions were all introducted to allow this to be debugged )
- added a 'get_lastfunction_header' method. if the API has not been called yet , raises a TwythonError. otherwise it attempts to return the header value twitter last sent. useful for x-ratelimit-limit , x-ratelimit-remaining , x-ratelimit-class , x-ratelimit-reset
* Changed the importing order for simplejson, if they have the library
installed, chances are they're going to want to use that over Python
json, json is slower than simplejson
* Version passing is now avaliable
* Catching json decode errors (ValueError) and Twitter Errors on
`_request` method and returning content rather than the response object.