diff -Naur python-twilio-2.0.8/examples/example-rest.py python-twilio-2.0.8-new/examples/example-rest.py --- python-twilio-2.0.8/examples/example-rest.py 2010-08-31 06:31:22.000000000 -0400 +++ python-twilio-2.0.8-new/examples/example-rest.py 2011-06-10 12:53:47.024568293 -0400 @@ -16,6 +16,22 @@ account = twilio.Account(ACCOUNT_SID, ACCOUNT_TOKEN) # =========================================================================== +# 0. Send an SMS (numbers might need verification depending on account type) + +d = { + 'From' : '415-599-2671', + 'To' : '415-555-1212', + 'Body' : 'Hello world SMS via python-twilio ' +} + +try: + print account.request('/%s/Accounts/%s/SMS/Messages' % \ + (API_VERSION, ACCOUNT_SID), 'POST', d) +except Exception, e: + print e + print e.read() + +# =========================================================================== # 1. Initiate a new outbound call to 415-555-1212 # uses a HTTP POST d = { diff -Naur python-twilio-2.0.8/twilio.py python-twilio-2.0.8-new/twilio.py --- python-twilio-2.0.8/twilio.py 2010-08-31 06:31:22.000000000 -0400 +++ python-twilio-2.0.8-new/twilio.py 2011-06-10 12:51:49.859964915 -0400 @@ -26,7 +26,14 @@ __VERSION__ = "2.0.8" import urllib, urllib2, base64, hmac -from hashlib import sha1 +# hashing functions depend on python version used - +try: + from hashlib import sha1 + +except ImportError: + import sha as sha1 + + from xml.sax.saxutils import escape, quoteattr try: