Skip to content

Instantly share code, notes, and snippets.

@hardlifeofapo
Created March 5, 2013 10:15
Show Gist options
  • Save hardlifeofapo/5089275 to your computer and use it in GitHub Desktop.
Save hardlifeofapo/5089275 to your computer and use it in GitHub Desktop.
exports.testSearch = function(req, res){
var results = [];
cb.connect(config, function( err, cb ){
if(err){
console.error("ERROR", err);
}else{
var cb = cb;
var ids = ["303894769166331904", "304176764836532225", "304179158878126081",
"304173762465644545", "304178136466219008", "304176597274066944",
"304178130334142465", "304178012117692416", "303894918307405824",
"304176631805800448"];//, "304178925779705857", "304178925779705857"];
var total = ids.length;
for(index in ids){
console.info("elem");
console.info(ids[index]);
cb.get( ids[index], function(err, data){
if(err){
console.info("err ===>");
console.info(err);
res.send(err, 500);
}else{
results.push(data);
if(results.length == total){
res.send(results);
}
}
}); //cb.get
}
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment