Created
April 11, 2013 10:21
-
-
Save ianAndrewClark/5362281 to your computer and use it in GitHub Desktop.
A CodePen by Ian Clark.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//d7xe6yl2ckrgs.cloudfront.net/js/2/importio.js"></script> | |
<script src="//d7xe6yl2ckrgs.cloudfront.net/js/0.1/hmac-sha1.js"></script> | |
<script src="//d7xe6yl2ckrgs.cloudfront.net/js/0.1/enc-base64-min.js"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queryModule = (function($, importio) { | |
// The query | |
var query = JSON.stringify({ | |
input: { "location/street_address/postal_code/postal_code": "ip2 0tg" }, | |
connectorGuids: [ "a9b2f9b7-09e3-487b-a9c1-d54f8c569178", "e7b6ea68-e52d-4639-bf02-f1952412ae70" ] | |
}, null, '\t'); | |
// Initialisation function | |
function init() { | |
// Init with the User GUID and API Key | |
importio.init({ | |
auth: { | |
userGuid: "7c574c79-0a4e-40af-8a9d-c6234137c230", | |
apiKey: "pu5vIRHiNfxO+yBqNg0BM8pKep9EugFKkgPD8lt+VXv1iGOMiEaBV4iDm3uwTk61GChQQKJfqWEvLsD0Pw7X7w==" | |
} | |
}); | |
} | |
// Execute a query | |
function execute() { | |
importio.query(JSON.parse(query())) | |
.message(msg) | |
.done(done); | |
} | |
function done(allData) { | |
//do something | |
} | |
return { | |
execute: execute, | |
} | |
})($, importio); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment