X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/57b544372e9aa8a41f9bdc84812d505a8730e3c6..d8a0b4a2a9a1f0fe1dd6ee21b8203d25f930c260:/twitter/api.py diff --git a/twitter/api.py b/twitter/api.py index 78296d5..2a9f935 100644 --- a/twitter/api.py +++ b/twitter/api.py @@ -8,6 +8,8 @@ except ImportError: from twitter.twitter_globals import POST_ACTIONS from twitter.auth import NoAuth +import re + try: import json except ImportError: @@ -83,6 +85,9 @@ def wrap_response(response, headers): def __init__(self, response, headers): response_typ.__init__(self, response) TwitterResponse.__init__(self, headers) + def __new__(cls, response, headers): + return response_typ.__new__(cls, response) + return WrappedTwitterResponse(response, headers) @@ -129,7 +134,7 @@ class TwitterCall(object): if not method: method = "GET" for action in POST_ACTIONS: - if uri.endswith(action): + if re.search("%s(/\d+)?$" % action, uri): method = "POST" break