-
Notifications
You must be signed in to change notification settings - Fork 0
/
Iconizer.sketchplugin
60 lines (45 loc) · 1.36 KB
/
Iconizer.sketchplugin
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// shortcut for Icons (shift option cmd ])
#import 'lib/oauth.js'
#import 'lib/sha1.js'
#import 'lib/utils.js'
/*
OAuth oauth_consumer_key="da62ada23d1c41b89ec7b8066f92b620", oauth_nonce="mjdzdMg2qWFXHqqIySO1JZ7wQUQpuKJo", oauth_signature="55F0v6wxqtM3WqVc4Dhhx6vLkk0%3D",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1415609719",
oauth_version="1.0"
*/
var secret = '4ec4a6afed804414b1e68b6bc901b947';
var oauth_consumer_key = "da62ada23d1c41b89ec7b8066f92b620";
var oauth_nonce,
oauth_signature;
var oauth_signature_method = "HMAC-SHA1";
var oauth_timestamp = parseInt([[NSDate date] timeIntervalSince1970]);
var oauth_version = "1.0";
//log(OAuth.nonce.chars);
var oa = new OAuth({}, function(){});
//log (oa);
var OAuth; if (OAuth == null) OAuth = {};
OAuth['nonce'] = function nonce(length) {
var chars = OAuth.nonce.CHARS;
var result = "";
for (var i = 0; i < length; ++i) {
var rnum = Math.floor(Math.random() * chars.length);
result += chars.substring(rnum, rnum+1);
}
return result;
}
OAuth.nonce.CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
log(OAuth.nonce(6));
//var layer = selection[0];
//var searchTerm = [layer stringValue];
/*
var iconData = {
'searchTerm' : searchTerm
}
*/
//var icon = getIcon();
/*
if (icon) {
[layer setStringValue:icon];
}
*/