anonymous / gist:199481
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:199481
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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.