Skip to content

Instantly share code, notes, and snippets.

var speakers = require('./speakers.json');
var request = require('request');
var bl = require('bl');
var urls = [];
for (x in speakers){
var UserName = speakers[x].GithubUserName;
if (UserName !== null && UserName.length > 0){
urls.push('https://api.github.com/users/' + UserName)
@Spencer-Allen
Spencer-Allen / 09_JugglingAsync.js
Last active August 29, 2015 14:05
LearnYouNode problem.
//THE EXERCISE:
//This problem is the same as the previous problem (HTTP COLLECT) in that you need to use http.get().
//However, this time you will be provided with three URLs as the first three command-line arguments.
//You must collect the complete content provided to you by each of the URLs and print it to the console (stdout).
//You don't need to print out the length, just the data as a String; one line per URL.
//The catch is that you must print them out in the same order as the URLs are provided to you as command-line arguments.
//MY ISSUE:
//This is problem #9 on LearnYouNode from nodeschool.io
var http = require('http');
var bl = require('bl');
var urls = [];
process.argv.slice(2).forEach(function(item){
urls.push(item)
});
console.log (urls)
{
"parentArray": [
{
"child_a": "sometext",
"child_b": "somemoretext"
},
{
"child_c": "abitmoretext",
"child_d": "lookatallofthistext"
}