Skip to content

Instantly share code, notes, and snippets.

@CiscoKidxx
Created August 2, 2016 05:15
Show Gist options
  • Save CiscoKidxx/a58954addc2701f2b276fc5d5cb88070 to your computer and use it in GitHub Desktop.
Save CiscoKidxx/a58954addc2701f2b276fc5d5cb88070 to your computer and use it in GitHub Desktop.
// Invoking the external __request function
__request.main(urls, function(responses) {
var url, response;
var firstRes = [];
// Looping through each url in the urls array
for (url in responses) {
// reference to the response object
response = responses[url];
// find errors
if (response.error) {
console.log("Error", url, response.error);
return;
}
// Parsing the response into JSON format
var rawJsonData = JSON.parse(response.body)
// Coupling the supplied URL to the response in a new object
var responseData = {
url: url,
res: rawJsonData.team_hitting_season_leader_master.queryResults.row
}
firstRes.push(responseData.res);
}
var secondRes = [firstRes[0][0]];
console.log(secondRes.length)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment