+import urllib2
+
+from exceptions import Exception
+
+def _py26OrGreater():
+ import sys
+ return sys.hexversion > 0x20600f0
+
+if _py26OrGreater():
+ import json
+else:
+ import simplejson as json
+
+class TwitterError(Exception):
+ """
+ Exception thrown by the Twitter object when there is an
+ error interacting with twitter.com.
+ """
+ pass
+
+# These actions require POST http requests instead of GET
+_POST_ACTIONS = [
+ "create", "update", "destroy", "new", "follow", "leave",
+ ]