This is a wrapper for the TextTeaser API
npm install text-teaser
Send request to the API
var key = process.env.TEXTTEASER_KEY
var subdomain = process.env.TEXTTEASER_DOMAIN || ''
var tt = require('text-teaser')(key, subdomain)
var data = {
title: 'TITLE...............',
text: 'TEXT...................'
}
tt.post(data, function(err, id){
if (err) { /* handle err */ }
console.log(id)
})
Get the summarized content from the API
var key = process.env.TEXTTEASER_KEY
var subdomain = process.env.TEXTTEASER_DOMAIN || ''
var tt = require('text-teaser')(key, subdomain)
var id = 123 // for example
tt.get(id, { count: 3 }, function(err, data){
if (err) { /* handle err */ }
console.log(data)
})
TEXTTEASER_KEY=YOUR_KEY npm test
MIT License