Commit graph

213 commits

Author SHA1 Message Date
devdave
b0d801b7bb Added numeric_types 2013-05-28 20:05:04 -05:00
devdave
a246743698 Added compat, numeric_types as allowed param type. 2013-05-28 20:03:20 -05:00
devdave
11acb49295 Allow for long's as well as ints for request params
_params['max_id']
330122291755220993L

type(_params['max_id'])
<type 'long'>

isinstance(_params['max_id'], int)
False

isinstance(_params['max_id'], (long,int))
True
2013-05-28 18:33:37 -05:00
Mike Helmick
050835e660 construct_api_url params as kwarg
Sometimes params isn't doesn't have to be passed
[ci skip]
2013-05-21 15:20:17 -04:00
Mike Helmick
126305d93d Revert removing unicode2utf8 and encode staticmethods
[ci skip]
2013-05-21 12:52:17 -04:00
Mike Helmick
c7bce9189f Update requests dependency, add str py2/3 compat, __repr__ definition, removed unicode2utf8 & encode static methods, update HISTORY
@ryanmcgrath Let me know if you're okay with the removal of
Twython.unicode2utf8 and Twython.encode. I moved Twython.encode to
_encode in helpers.py (only place being used is
Twython.construct_api_url) If it's python 2 and unicode then we encode
it, otherwise return the original value

[ci skip]
2013-05-21 11:41:43 -04:00
Mike Helmick
3dbef22cee Remove unused compat types from compat.py
[ci skip]
2013-05-20 10:31:32 -04:00
Mike Helmick
35d8402173 Include ints in params too
Oops ;P
2013-05-16 14:45:38 -04:00
Mike Helmick
c42a987f38 basestring compat for python 3 transparent params 2013-05-16 14:32:58 -04:00
Mike Helmick
27c51b8ba6 Fixes #192, update HISTORY 2013-05-16 14:15:11 -04:00
Mike Helmick
ea0b646fd1 Fixes #194
[ci skip]
2013-05-16 12:40:25 -04:00
Mike Helmick
5534ea2480 Fixes #193, fixed when Warning is raised, fixed error raising, version bump
- Added `get_retweeters_ids` method
- Fixed `TwythonDeprecationWarning` on camelCase functions if the
camelCase was the same as the PEP8 function (i.e. ``Twython.retweet``
did not change)
- Fixed error message bubbling when error message returned from Twitter
was not an array (i.e. if you try to retweet something twice, the error
is not found at index 0)
2013-05-10 21:28:57 -04:00
Mike Helmick
600f36c6ba Catch the four methods that won't get caught with our deprecation fix 2013-05-04 19:46:23 -04:00
Mike Helmick
828d355ad2 Update version 2013-05-04 19:29:55 -04:00
Mike Helmick
84e4c5fe13 Update all endpoints in the api_table, examples, READMEs
Also updated functions in twython.py to use pep8 functions instead of
camelCase functions
2013-05-04 19:28:47 -04:00
Mike Helmick
cea0852a42 Updating file structure and HISTORY.rst 2013-05-03 17:33:17 -04:00
Mike Helmick
97a33ce8dd Merge Handling into TwythonStreamer, update examples 2013-05-03 16:57:59 -04:00
Mike Helmick
c3e84bc8ee Fixing streaming 2013-05-02 15:12:36 -04:00
Mike Helmick
b6e820d792 Remove version.py for now
Was causing conflicts on pip install
2013-04-29 12:04:22 -04:00
Mike Helmick
776e02b071 Updated AUTHORS, HISTORY; added ssl_verify; removed _media_update
- Added @jvanasco to the AUTHORS.rst
- Updated History
- Removed _media_update internal function
- Twython now takes ssl_verify param
2013-04-29 11:27:15 -04:00
Mike Helmick
a451db43c1 Removed bulkUserLookup & getProfileImageUrl, deprecating shortenUrl, raise TwythonDepWarnings in Python 2.7 > 2013-04-22 21:29:07 -04:00
Mike Helmick
d4c19fc3a9 Version bump 2013-04-19 02:14:22 -04:00
Mike Helmick
bb019d3a57 Making twython work (again?) in Python 3
- Added a ``HISTORY.rst`` to start tracking history of changes
- Updated ``twitter_endpoints.py`` to ``endpoints.py`` for cleanliness
- Removed twython3k directory, no longer needed
- Added ``compat.py`` for compatability with Python 2.6 and greater
- Added some ascii art, moved description of Twython and ``__author__`` to ``__init__.py``
- Added ``version.py`` to store the current Twython version, instead of repeating it twice -- it also had to go into it's own file because of dependencies of ``requests`` and ``requests-oauthlib``, install would fail because those libraries weren't installed yet (on fresh install of Twython)
- Removed ``find_packages()`` from ``setup.py``, only one package -- we can
just define it
- added quick publish method for Ryan and I: ``python setup.py publish`` is faster to type and easier to remember than ``python setup.py sdist upload``
- Removed ``base_url`` from ``endpoints.py`` because we're just repeating it in
``Twython.__init__``
- ``Twython.get_authentication_tokens()`` now takes ``callback_url`` argument rather than passing the ``callback_url`` through ``Twython.__init__``, ``callback_url`` is only used in the ``get_authentication_tokens`` method and nowhere else (kept in init though for backwards compatability)
- Updated README to better reflect current Twython codebase
- Added ``warnings.simplefilter('default')`` line in ``twython.py`` for Python 2.7 and greater to display Deprecation Warnings in console
- Added Deprecation Warnings for usage of ``twitter_token``, ``twitter_secret`` and ``callback_url`` in ``Twython.__init__``
- Headers now always include the User-Agent as Twython vXX unless User-Agent is overwritten
- Removed senseless TwythonError thrown if method is not GET or POST, who cares -- if the user passes something other than GET or POST just let Twitter return the error that they messed up
- Removed conversion to unicode of (int, bool) params passed to a requests. ``requests`` isn't greedy about variables that can't be converted to unicode anymore
2013-04-18 22:00:23 -04:00
Mike Helmick
8ecc55b5ad Merge pull request #180 from namimi/master
Comments correction for get_lastfunction_header()
2013-04-15 13:45:39 -07:00
Mike Helmick
6d1c439a89 Move Exceptions to own file 2013-04-15 16:12:02 -04:00
Adrien Tronche
023b29b202 Small correction in comments
Headers have changed and a - is now needed between rate and limit.
2013-04-14 00:16:28 -03:00
Mike Helmick
d228e04bc0 Version bump! 2013-04-12 11:40:05 -04:00
Mike Helmick
7469f8bc73 Fixes #175, #177
* Auth Errors are thrown in the correct spots
* Error messages are a lot cleaner than before and correspond with
error codes on https://dev.twitter.com/docs/error-codes-responses
2013-04-12 11:17:40 -04:00
Greg Nofi
12eb1610c8 Use built-in Exception attributes for storing and retrieving error message.
Keeping msg as a property so it's backwards compatible.

Note that this only fixes Python 2.x
2013-04-11 19:42:16 -04:00
Mike Helmick
10dbe11b56 Version bump and update contributors! 2013-04-08 16:40:59 -04:00
Virendra Rajput
6a3539882c Update twython.py
if unicode object is detected, convert it to json using simplejson/json
2013-04-08 22:59:27 +05:30
Mike Helmick
4a181d3ac1 Version bump! 2013-04-08 11:51:34 -04:00
Mike Helmick
abaa3e558a oauth_verifier required, remove simplejson dependency, update endpoint
* Update `updateProfileBannerImage` to use the v1.1 endpoint

* Added `getProfileBannerSizes` method using the GET
/users/profile_banner.json endpoint

* Fixed a couple of endpoints using variable in the url:
  * destroyDirectMessage, createBlock, destroyBlock no longer use id in
their urls, this shouldn't break anything though.
(t.destroyDirectMessage(id=123) should still work)

* `oauth_verifier` is now **required** when calling
`get_authorized_tokens`

* Updated docs - removed getProfileImageUrl docs since it is
deprecated. Noted since `Twython` 2.7.0 that users should focus on
migrating to v1.1 endpoints since Twitter is deprecating v1 endpoints
in May!,
2013-04-08 11:49:12 -04:00
hansenrum
1eb1bd080d moved oauth_verifier from init to method 2013-04-05 18:36:58 +02:00
hansenrum
26b3a232d0 oauth_verifier fix 2013-04-05 00:25:23 +02:00
Paul
99a6dccbce added oauth_verifier arg 2013-04-05 00:12:54 +02:00
Mike Helmick
e65790d717 New showOwnedLists method
Returns the lists owned by the specified Twitter user. Private lists
will only be shown if the authenticated user is also the owner of the
lists.
2013-04-04 14:52:54 -04:00
Mike Helmick
fffedd4588 Version bump 2013-04-04 14:52:32 -04:00
Mike Helmick
7d1ffefc45 Fixes #158, #159, #160 2013-04-04 14:44:05 -04:00
Mike Helmick
a6afb2cf5c Version bump! 2013-03-31 12:38:07 -04:00
Virendra Rajput
454a41fe94 added the missing slash in "getMentionsTimeline"
was unable to fetch mentions because of the missing slash and the missing '.json'
2013-03-31 21:23:16 +05:30
Mike Helmick
a172136f3e Update Twitter Endpoints & Internal Functions
* Twitter Endpoints are now in the order of
https://dev.twitter.com/docs/api/1.1

* No need to repeat search function internally when it is available via
`twitter_endpoints.py`

* Make `searchGen` use self.search, instead of self.get with the full
search url
2013-03-20 23:24:26 -04:00
Ryan McGrath
dfca6c533e Merge pull request #141 from rmerlorangeknocks/master
Updating getRateLimiStatus endpoint
2013-02-15 08:20:58 -08:00
Ryan McGrath
2bbed505d5 Merge pull request #143 from gdevanla/update_error_code
Update error code to 429 - (to catch rate limit exceptions)
2013-02-15 08:18:06 -08:00
Ryan McGrath
b870d44f28 Merge pull request #149 from myusuf3/master
if you dont pass in header you asked for explicitly all are returned.
2013-02-15 08:16:30 -08:00
Mahdi Yusuf
b0f5af37d5 Update twython/twython.py
updating default version of api as well. come on playa.
2013-02-05 16:53:47 -05:00
Mahdi Yusuf
dbf2a461b8 Update twython/twython.py
making it so that when you don't pass in header you get all of them back.
2013-02-05 16:18:56 -05:00
Sam Mellor
f0db93c59e updated for requests==1.1.0 2013-01-30 01:00:32 +11:00
Guru Devanla
a28febb0b4 update error code and comment 2013-01-15 16:43:50 -06:00
Guru Devanla
7f0751c27e Update error code for Twitter Rate Limits. This is for Twitter Api 1.1 2013-01-15 16:40:57 -06:00