lib/helpers.js
function httpRequest(url) {
    var deferred = Q.defer();
    request(url, function(err, response, body) {
      if (err) {
        deferred.reject(new Error(err));
      } else if (!err && response.statusCode !== 200) {
        deferred.reject(new Error(response.statusCode));
      } else {
        deferred.resolve(body);
      }
    });
    return deferred.promise;
  }
function httpRequest(url) {
    var deferred = Q.defer();
    request(url, function(err, response, body) {
      if (err) {
        deferred.reject(new Error(err));
      } else if (!err && response.statusCode !== 200) {
        deferred.reject(new Error(response.statusCode));
      } else {
        deferred.resolve(body);
      }
    });
    return deferred.promise;
  }
function httpRequest ( url ) { var deferred = Q . defer ( ) ; request ( url , function ( err , response , body ) { if ( err ) { deferred . reject ( new Error ( err ) ) ; } else if ( ! err && response . statusCode !== 200 ) { deferred . reject ( new Error ( response . statusCode ) ) ; } else { deferred . resolve ( body ) ; } } ) ; return deferred . promise ; }
Helper function that handles the http request

@param {string} url
Helper function that handles the http request