How to use the restler.get function in restler

To help you get started, we’ve selected a few restler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular-app / angular-app / server / lib / mongo-strategy.js View on Github external
MongoDBStrategy.prototype.query = function(query, done) {
  query.apiKey = this.apiKey;     // Add the apiKey to the passed in query
  var request = rest.get(this.baseUrl, { query: query });
  request.on('error', function(err, response) { done(err, null); });
  request.on('fail', function(err, response) { done(err, null); });
  request.on('success', function(data) { done(null, data); });
};
github kersten / vdr-guia / src.bak / mvc.js View on Github external
function checkVDRPlugins () {
        console.log('VDR check for plugins');
        
        rest.get(restfulUrl + '/info.json').on('complete', function(data) {
            vdr.plugins.epgsearch = false;

            for (var i in data.vdr.plugins) {
                vdr.plugins[data.vdr.plugins[i].name] = true;
            }

            setupBasics();
        });
    }
github martindale / snarl / bot.js View on Github external
Chat.find({}).sort('-timestamp').limit(1).exec(function(err, lastChat) {
              var now = new Date();
              var difference = ( now - lastChat.timestamp ) / 1000;
              if (difference >= 300) {
                rest.get('http://api.urbandictionary.com/v0/define?term='+token).on('complete', function(data) {
                  self.chat(data.list[0].definition);
                });
              }
            });
          }
github BETaaS / BETaaS_Platform-Tools / betaas-utils / betaasconsole / server / modules / esModule.js View on Github external
function checkService(res,url) {
    console.log('path will be '+durl+':'+dport + pathstatus+"/"+url);
    rest.get(durl+':'+dport + pathstatus+"/"+url).
    on('complete', function (data, response) {
        console.log(data);
        console.log(response.statusCode);
        res.send(data);

    });
}
github BETaaS / BETaaS_Platform-Tools / betaas-utils / betaasconsole / server / modules / esModule.js View on Github external
function stopService(res,url) {
    rest.get(durl+':'+dport + pathstop+"/"+url).
    on('complete', function (data, response) {
        console.log(data);
        console.log(response.statusCode);
        res.send(data);

    });
}
github BETaaS / BETaaS_Platform-Tools / betaas-utils / betaasconsole / server / modules / esModule.js View on Github external
function startService(res,url) {
   rest.get(durl+':'+dport + pathstart+"/"+url).
    on('complete', function (data, response) {
        console.log(data);
        console.log(response.statusCode);
        res.send(data);

    });
}
github kersten / vdr-guia / src / application / backend / plugins / Setup / index.js View on Github external
checkrestful: function (data, cb) {
            var sendFalse = setTimeout(function () {
                cb({reachable: false});
            }, 10000);

            rest.get('http://' + data.vdrhost + ':' + data.restfulport + '/info.json').on('success', function(data) {
                clearTimeout(sendFalse);
                cb({reachable: true});
            }).on('error', function () {
                clearTimeout(sendFalse);
                cb({reachable: false});
            });
        },
github FabricLabs / soundtrack / lib / YouTube.js View on Github external
YouTube.prototype.get = function(url, params, cb) {
  var self = this;

  params.key = self.key;

  var qs = Object.keys( params ).map(function(k) {
    return k + '=' + params[k];
  });

  rest.get( self.base + url + '?' + qs.join('&') ).on('complete', function(data) {
    cb( null , data );
  });
}
github csvignesh / image-to-text / index.js View on Github external
function getDecodedText(token){
    var restlerPromise = Q.defer();

    rest.get(constants.POOLING_URL + token, {
        headers: constants.AUTH_HEADERS
    }).on('complete', function(data){
        restlerPromise.resolve(data);
    });

    return restlerPromise.promise;
}
github cloudflare / collapsify / lib / utility.js View on Github external
return Q.promise(function(resolve) {

      var options = {};

      options.headers = JSON.parse(JSON.stringify(headers));
      options.headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0';

      restler.get(resourceURL, options).on('complete', function(data, resp) {
        if (data instanceof Error || resp.statusCode === 404) {
          return resolve(new Buffer(''));
        }
        resolve(resp.raw);
      });
    });
  };

restler

An HTTP client library for node.js

MIT
Latest version published 9 years ago

Package Health Score

51 / 100
Full package analysis

Popular restler functions