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

klout-js

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

klout-js - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

32

example.js

@@ -0,23 +1,29 @@

// example usage of klout-js - queries one existing and one missing klout profiles
// call providing your Klout API key as argument
// eg. node example.js 1234abc
var klout = require('./klout-js.js')(process.argv[2]);
klout.klout(['smurthasmith', 'jeremie'], function(err, data) {
console.log('getKloutScore:', data);
klout.klout(['smurthas', 'jeremie'], function(err, data) {
console.log('getKloutScore:\n', JSON.stringify(data, true, 4));
console.log('.....................');
});
klout.show(['smurthasmith', 'jeremie'], function(err, data) {
console.log('getKloutScore:', data);
klout.show(['smurthas', 'jeremie'], function(err, data) {
console.log('getKloutProfile:\n', JSON.stringify(data, true, 4));
console.log('.....................');
});
klout.topics(['smurthasmith', 'jeremie'], function(err, data) {
console.log('getKloutScore:', data);
klout.topics(['smurthas', 'jeremie'], function(err, data) {
console.log('getKloutTopics:\n', JSON.stringify(data, true, 4));
console.log('.....................');
});
//these endpoints don't seem to work, if anyone can get them to work, please help!!
/*
klout.influencedBy(['smurthasmith', 'jeremie'], function(data) {
console.log('getKloutScore:', data);
klout.influencedBy(['smurthas', 'jeremie'], function(err, data) {
console.log('getKloutInfluencers:\n', JSON.stringify(data, true, 4));
console.log('.....................');
});
klout.influencerOf(['smurthasmith', 'jeremie'], function(data) {
console.log('getKloutScore:', data);
});*/
klout.influencerOf(['smurthas', 'jeremie'], function(err, data) {
console.log('getKloutInfluencees:\n', JSON.stringify(data, true, 4));
console.log('.....................');
});

@@ -9,3 +9,3 @@ var request = require('request');

function makeRequest(endpoint, usernames, callback) {
request.get({uri:BASE + endpoint + '.json?key=' + client.API_KEY + '&users=' + usernames},
request.get({uri:BASE + endpoint + '.json?key=' + client.API_KEY + '&users=' + usernames, json:true},
function(err, resp, body) {

@@ -15,3 +15,3 @@ if(err)

else
callback(null, JSON.parse(body));
callback(null, body);
});

@@ -29,9 +29,8 @@ }

};
//these endpoints don't seem to work, if anyone can get them to work, please help!!
/* client.influencedBy = function (usernames, callback) {
client.influencedBy = function (usernames, callback) {
makeRequest('soi/influenced_by', usernames, callback);
};
client.influencerOf = function (usernames, callback) {
makeRequest('soi/influenced_of', usernames, callback);
};*/
makeRequest('soi/influencer_of', usernames, callback);
};

@@ -38,0 +37,0 @@ return client;

@@ -5,3 +5,3 @@ {

"main":"klout-js.js",
"version": "0.0.2",
"version": "0.0.3",
"author": "Simon Murtha-Smith <simon@murtha-smith.com>",

@@ -15,4 +15,4 @@ "keywords": ["klout"],

"dependencies": {
"request" : "=1.9.5"
"request" : ">=2.2.0"
}
}

@@ -31,4 +31,2 @@ # klout-js

Follow [@smurthasmith](http://twitter.com/smurthasmith) for updates!
Also, the SOI endpoints don't seem to be working, anyone know why?
Follow [@smurthasmith](http://twitter.com/smurthasmith) for updates!
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