-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample_signed.html
46 lines (43 loc) · 1.82 KB
/
example_signed.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<script src='http://code.jquery.com/jquery-1.11.0.min.js'></script>
<script src='https://s3.amazonaws.com/web.blitline/underscore-min.js'></script>
<script src='blitline_cors.js'></script>
<script type="text/javascript">
$(document).ready(function() {
// Reminders:
// Public Token can be found on your blitline home page
// Secret can be found on your blitline home page
// Expires is determined by YOU and represents when this signature will NO LONGER work
// Signature is the SHA256 hexdigest of <SECRET> + expires (in the RFC822 ISO string format)
var myAppId = {
"expires" : "Wed, 1 Jan 2014 00:00:00 +0000",
"signature" : "853c511a9ee225d3182bde4151857552a7f3f95d",
"public_token" : "ZlxIi7oLQqnpJhGhPSgIbA"
};
var blitline = new Blitline();
var events = {
completed : function(results, error) {
alert("Job completed:" + JSON.stringify(results));
}
}
var json = { "src" : "http://www.google.com/logos/2011/yokoyama11-hp.jpg", "functions" : [ {"name": "blur", "params" : {"radius" : 0.0, "sigma" : 2.0}, "save" : { "s3" : { "bucket" : "bltemp.shortline", "key" : "myexample.jpg" }, "image_identifier" : "MY_CLIENT_ID" }} ]};
if (typeof myAppId == 'string' || myAppId instanceof String) {
json["application_id"] = myAppId;
}else {
json["expires"] = myAppId["expires"];
json["signature"] = myAppId["signature"];
json["public_token"] = myAppId["public_token"];
}
json = JSON.stringify(json);
blitline.submit(json, events);
});
</script>
</head>
<body>
</body>