GithubHelp home page GithubHelp logo

node_klout's Introduction

node_klout

Simple wrapper for the Klout API. Users is an array. The constructor supports passing XML, but I haven't implemented that yet. Like the API, users is always an array.

To run the tests, edit ./test/test.js, replacing YOUR_KEY with your application's API key, then:

node test/test

Version v2

In order to use the v2 API, instantiate a new instance of node_klout like so:

var Klout = require("node_klout"),
	klout = new Klout("YOUR_V2_KEY", "json", "v2");

or:

var Klout = require("node_klout"),
	klout = new Klout().setKey("YOUR_V2_KEY").setVersion("v2");

Node_klout supports the retrieval of a user's Klout identifier by Twitter screen name or numeric identifier.

klout.getKloutIdentity(twitter_screen_name_or_identifier, function(error, klout_user) {
	...
});

The returned klout_user variable is an object as documented by the Klout API v2 docs:

{
	"id": "123456789",
	"network": "ks"
}

The following methods are supported, where klout_response is an object as documented by the Klout API v2 docs:

klout_v2.getUser(klout_id, function(error, klout_response) {
	// Returns a user object
});

klout_v2.getUserScore(klout_id, function(error, klout_response) {
	// Returns a user's score object
});	

klout_v2.getUserTopics(klout_id, function(error, klout_response) {
	// Returns an array of user topics
});	

klout_v2.getUserInfluence(klout_id, function(error, klout_response) {
	// Returns a user's influence object
});

klout_v2.getUserNetworkHandle(klout_id, function(error, klout_response) {
	// Returns a user's network (Twitter) identifier
});

Version 1

All methods are supported:

var Klout = require("node_klout"),
	klout = new Klout("YOUR_KEY");

klout.getKlout("_cojohn", function(error, users) {
	console.log(users);
});

klout.getSingleKlout("_cojohn", function(error, score) {
	console.log(score);
});

klout.getShow("_cojohn", function(error, users) {
	console.log(users);
});
	
klout.getTopics("_cojohn", function(error, users) {
	console.log(users);
});

klout.getInfluencedBy("_cojohn", function(error, users) {
	console.log(users);
});

klout.getInfluencerOf("_cojohn", function(error, users) {
	console.log(users);
});

node_klout's People

Contributors

cojohn avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.