]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/api.py
Use a regex to deduce better which actions should use POST. Patch by Daniel Jones...
[z_archive/twitter.git] / twitter / api.py
index 30ccb76bf32b9421816596b80028b303926aec69..2a9f93556cd0bf60c87597752d5fb74547854b04 100644 (file)
@@ -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:
@@ -132,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