Advertisement
Guest User

Untitled

a guest
May 27th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var http = require('http');
  2.  
  3. function getTestPersonaLoginCredentials(callback) {
  4.  
  5.     return http.get({
  6.         host: 'terrenceko.com',
  7.         path: '/playground'
  8.     }, function(response) {
  9.         // Continuously update stream with data
  10.         var body = '';
  11.         response.on('data', function(d) {
  12.             body += d;
  13.         });
  14.         response.on('end', function() {
  15.  
  16.             // Data reception is done, do whatever with it!
  17.             var parsed = JSON.parse(body);
  18.             callback({
  19.                 email: parsed.email,
  20.                 password: parsed.pass
  21.             });
  22.         });
  23.     });
  24.  
  25. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement