Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flurry-api

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flurry-api - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

33

lib/flurry.js
var request = require('request'),
Promise = require('bluebird'),
util = require('./util'),

@@ -26,18 +27,22 @@ Metric = require('./metric');

Flurry.prototype[i] = function(callback){
request.get('http://api.flurry.com/appInfo/' + i, {
headers: {
'Content-Type': 'application/json'
},
qs: {
apiAccessCode: this.options.apiAccess,
apiKey: this.options.apiKey
}
}, function(err, res, body){
if (err) return callback(err);
if (typeof callback !== 'function') callback = function(){};
var data = JSON.parse(body);
if (res.statusCode !== 200) return callback(util.formatError(data));
return new Promise(function(resolve, reject){
request.get('http://api.flurry.com/appInfo/' + i, {
headers: {
'Content-Type': 'application/json'
},
qs: {
apiAccessCode: this.options.apiAccess,
apiKey: this.options.apiKey
}
}, function(err, res, body){
if (err) return reject(err);
callback(null, data);
});
var data = JSON.parse(body);
if (res.statusCode !== 200) return reject(util.formatError(data));
resolve(data);
});
}).nodeify(callback);
};

@@ -44,0 +49,0 @@ });

var request = require('request'),
Promise = require('bluebird'),
util = require('./util');

@@ -42,15 +43,19 @@

Metric.prototype.exec = function(callback){
request.get(this.base, {
headers: {
'Content-Type': 'application/json'
},
qs: this.params
}, function(err, res, body){
if (err) return callback(err);
if (typeof callback !== 'function') callback = function(){};
var data = JSON.parse(body);
if (res.statusCode !== 200) return callback(util.formatError(data));
return new Promise(function(resolve, reject){
request.get(this.base, {
headers: {
'Content-Type': 'application/json'
},
qs: this.params
}, function(err, res, body){
if (err) return reject(err);
callback(null, data);
});
var data = JSON.parse(body);
if (res.statusCode !== 200) return reject(util.formatError(data));
resolve(data);
});
}).nodeify(callback);
};
{
"name": "flurry-api",
"version": "0.0.3",
"version": "0.0.4",
"description": "Flurry API for Node.js",

@@ -29,4 +29,5 @@ "main": "lib/flurry",

"dependencies": {
"bluebird": "^2.2.2",
"request": "^2.37.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc