Skip to content

Instantly share code, notes, and snippets.

@jcleblanc
Created September 3, 2010 00:44
Show Gist options
  • Save jcleblanc/563205 to your computer and use it in GitHub Desktop.
Save jcleblanc/563205 to your computer and use it in GitHub Desktop.
/****************************************************
* Method: Get YQL Data
* Description: Use the query provided to make a
* request to YQL endpoint to capture data
*****************************************************/
var getYQLData = function(query){
//prepare the URL for public YQL queries:
var sURL = yqlPublicQueryURL + "q=" + encodeURI(query) + "&format=json&callback=yqlWidget.getYQLDataCallback";
//add any environment files specified in the config
if (setupConfig["env"]) {
sURL += '&env=' + escape(setupConfig["env"]);
}
//make GET request to YQL with provided query
var transactionObj = YAHOO.util.Get.script(sURL, {
onSuccess : onYQLReqSuccess,
onFailure : onYQLReqFailure,
scope : this
});
return transactionObj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment