diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-25 14:52:44 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-25 14:52:44 -0400 |
| commit | 365e6c93c1a57bb45d2ea274218378f642b4d425 (patch) | |
| tree | 6b22b1a9e26a9fa8883e3148f0547dbb3404cd7e /StoneIsland/www/js/sdk/_sdk.js | |
| parent | 7acf0f1f7f7af782981e6001370f46c4dd7460d2 (diff) | |
split up api
Diffstat (limited to 'StoneIsland/www/js/sdk/_sdk.js')
| -rw-r--r-- | StoneIsland/www/js/sdk/_sdk.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/StoneIsland/www/js/sdk/_sdk.js b/StoneIsland/www/js/sdk/_sdk.js new file mode 100644 index 00000000..073d6c0d --- /dev/null +++ b/StoneIsland/www/js/sdk/_sdk.js @@ -0,0 +1,36 @@ +var sdk = (function(){ + var sdk = {} + + // var endpoint = "https://secure.api.yoox.biz/" + var endpoint = "https://sandbox.api.yoox.biz/" + + sdk.headers = { + "x-yoox-appname": "{API-TEST}", + "x-yoox-api-key": "{API-KEY}", + "x-yoox-device": "smartphone", + } + + sdk.path = function(api, path){ + return endpoint + api + "/STONEISLAND_US/" + path + } + + sdk.fetch_collection = function(opt){ + $.ajax({ + method: "GET", + url: sdk.path("Search.API/1.2", "search.json"), + data: { format: "full", gallery: opt.gallery_id }, + success: opt.success, + }) + } + + sdk.image = function(code){ + return "http://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_11_f.jpg" + } + + $.ajaxSetup({ + // possibly: application/json; charset=utf-8" + contentType: "application/json", + }) + + return sdk +})()
\ No newline at end of file |
