Created — forked from isaiah/gist:199468

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:214133
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
require "rubygems"
require "hmac-sha1"
require "base64"
ankoder_access_key = ANKODER_ACCESS_KEY
private_key = ANKODER_PRIVATE_KEY
ankoder_date = Time.now.strftime("%a, %d %b %Y %X GMT")
ankoder_action = "GET"
ankoder_path = "/video.xml"
string = "-#{ankoder_date}-#{ankoder_action}-#{ankoder_path}-"
 
salt = Digest::SHA1.hexdigest(string)[0..19]
 
passkey = Base64.encode64(HMAC::SHA1::digest(private_key, salt)).strip
 
res = `curl api.localankoder.com/video.xml -X GET -H "ankoder_access_key: #{ankoder_access_key}" -H "ankoder_passkey: #{passkey}" -H "ankoder_date: #{ankoder_date}"`
 
puts res
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.