Created
August 2, 2016 05:15
-
-
Save CiscoKidxx/a58954addc2701f2b276fc5d5cb88070 to your computer and use it in GitHub Desktop.
This file contains 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
// 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