lamernews-client

1.1.0 • Public • Published

lamernews-client

A simple Node.js client to the LamerNews API

Installation

npm i -S lamernews-client

Usage

The example shown below will post some news to a LamerNews-powered site.

var lamer = require('lamernews-client');
var client = lamer.createClient({ api: 'http://www.echojs.com' });
 
client.login({
  username: '{{username}}',
  password: '{{password}}'
}, logged);
 
function logged () {
  client.submit({
    title: 'testing lamernews-client!',
    url: 'https://github.com/bevacqua/lamernews-client'
  }, remove);
}
 
function remove (err, data) {
  client.remove(data, done);
}
 
function done (err) {
  t.end();
}

Just want a list of new articles posted on EchoJS?

var lamer = require('lamernews-client');
var client = lamer.createClient({ api: 'http://www.echojs.com' });
 
client.list({}, listed);
 
function listed (err, body) {
  console.log(err, body);
  t.end();
}

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1
  • 1.0.1
    0
  • 1.0.0
    1

Package Sidebar

Install

npm i lamernews-client

Weekly Downloads

2

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bevacqua