Guest User

Untitled

a guest
Oct 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. for(var i = 0; i <= 1 ; i++){
  2. apiRequest = data[i];
  3. apicall(apiRequest);
  4. }
  5.  
  6.  
  7. function apicall(urlApi){
  8. request((urlApi), function(error, response, body){
  9. if(error){
  10. console.log("error");
  11. } else if(!error && response.statusCode == 200){
  12. var myobj = JSON.parse(body);
  13. dbInsert(myobj);
  14. }
  15. });
  16. }
  17.  
  18. function dbInsert(obj) {
  19. //insert into database
  20. }
Add Comment
Please, Sign In to add comment