Skip to content

anonymous /gist:199481

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
import time
import base64
import hmac
from hashlib import sha1
def create_signature(date, method, path):
data = "-%s-%s-%s-" % (date, method, path)
salt = sha1(data).hexdigest()[:20]
return base64.encodestring(hmac.new("ANKODER_PRIVATE_KEY", salt, sha1).digest()).strip()
date = time.strftime("%a, %d %b %Y %X GMT", time.gmtime())
date = "Fri, 02 Oct 2009 05:58:43 GMT"
sig = create_signature(date, "GET", "/profile")
print 'curl api.ankoder.com/profile -X GET -H "ankoder_access_key: ANKODER_ACCESS_KEY" -H "ankoder_passkey: %s" -H "ankoder_date: %s"' % (sig, date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.