node-kippt
A wrapper for the Kippt API.
Installation
You can install using Node Package Manager (npm)
npm install node-kippt
Or define in your package.json
dependencies
Usage
Refer to the Kippt developer API page for information about the API response.
Initialize
var Kippt = require('node-kippt');
var kippt = new Kippt.KipptAPI({
username: 'YOUR_USERNAME',
api_token: 'API_TOKEN'
});
Clips API
kippt.clips.all(function(error, data) {
if(!error) console.log(data);
});
kippt.clips.getById(CLIP_ID, function(error, data) {
if(!error) console.log(data);
});
kippt.clips.add({
url: "Clip's url",
title: "Clip's title",
list: "resource_uri for clip's list",
notes: "Notes for the clip",
is_starred: Boolean,
is_read_later: Boolean
}, function(error, data) {
if(!error) console.log(data);
});
kippt.clips.update({
id: CLIP_ID,
other_options: ''
}, function(error, data) {
if(!error) console.log(data);
});
kippt.clips.remove(CLIP_ID, function(error, data) {
if(!error) console.log('SUCCESS');
});
kippt.clips.search({
q: 'search_query',
is_starred: Boolean
}, function(error, data) {
if(!error) console.log(data);
});
Lists API
kippt.lists.all(function(error, data) {
if(!error) console.log(data);
});
kippt.lists.getById(LIST_ID, function(error, data) {
if(!error) console.log(data);
});
kippt.lists.add({
title: "list title",
is_private: Boolean
}, function(error, data) {
if(!error) console.log(data);
});
kippt.lists.update({
id: LIST_ID,
title: "list title",
is_private: Boolean
}, function(error, data) {
if(!error) console.log(data);
});
kippt.clips.remove(LIST_ID, function(error, data) {
if(!error) console.log('SUCCESS');
});