Install this version via git:
npm install git://github.com/jiin/kippt
And use in your node source:
var Kippt = require('kippt');
You can use API only if you are authenticated. You can authenticate via API Token or via username/password combination.
var client = new Kippt({
username: 'your_nickname'
, api_token: '31e4d0b0d47acaf3ebbeb187d17d67cfddec79c1'
});
var client = new Kippt({
username: 'your_nickname'
, password: 'your_password'
});
var client = new Kippt({
username: 'your_nickname'
, api_token: '31e4d0b0d47acaf3ebbeb187d17d67cfddec79c1'
});
client.account( function( err, result ) {
console.log( result );
});
Output:
{
username: 'your_nickname',
app_url: '/your_nickname',
lists: '/api/users/your_nickname/lists/',
avatar_url: 'your_avatar',
api_token: '31e4d0b0d47acaf3ebbeb187d17d67cfddec79c1',
id: 666666,
resource_uri: '/api/users/666666/'
}
Return object contains all the lists:
client.lists( function( err, lists ) {
console.log( lists );
});
Only returns the list that id is the first argoument.
client.lists('123456', function( err, lists ) {
console.log( lists );
});
Limit and offset can be controlled:
client.lists({ limit: 5, offeset: 2 }, function( err, lists ) {
console.log( lists );
});
Return object contains all the clips:
client.clips( function( err, clips ) {
console.log( clipss );
});
Only returns the clips that id is the first argoument.
client.clips('654321', function( err, lists ) {
console.log( clipss );
});
Limit and offset can be controlled:
client.clips({ limit: 5, offeset: 2 }, function( err, clips ) {
console.log( clips );
});
Return clips searched:
client.search('css', function( err, result ) {
console.log( result );
});
You can return the starred clips:
client.starred(function( err, starred ) {
console.log( starred );
});
You can create a clip:
client.add({ type: 'clips' },{ title: 'new_clip', url: 'your_url' }, function( err, result ) {
console.log( result );
});
You can create a list:
client.add({ type: 'lists' },{ title: 'new_clip', url: 'your_url' }, function( err, result ) {
console.log( result );
});
You can update a clip:
client.update({ type: 'clips', id: '654321' }, { url: 'http://newurl.com/' }, function( err, result ) {
console.log( result );
});
You can update a list:
client.update({ type: 'lists', id: '654321' }, { name: 'newname' }, function( err, result ) {
console.log( result );
});
You can deleting a clip:
client.delete({ type: 'clips', id: '123456' }, function( err, result ) {
console.log( result );
});
You can deleting a list:
client.delete({ type: 'lists', id: '654321' }, function( err, result ) {
console.log( result );
});