1.1.0 • Published 10 years ago

lamernews-client v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago