0.0.9 • Published 10 years ago

no-plebs v0.0.9

Weekly downloads
4
License
BSD
Repository
github
Last release
10 years ago

No Plebs

Commenting module for your blog.

This is a standalone module to connect to any blog that can be pinned to a specific URL or identifier, an author and a comment.

Setting up

var n = new NoPlebs({
  db: './db-no-plebs',
  limit: 25
});

Add a comment

n.addComment('that track is amazing. wow mom.', 'http://someblog.com/123', <author>, function (err, comment) {
  if (!err) {
    console.log(comment);
  }
});

author is an identifier for the user posting. This can be whatever you want - Twitter username, real name, etc.

Get all recent comments

n.getComments('http://someblog.com/123', <reverse>, function (err, comments) {
  if (!err) {
    console.log(comments);
  }
});

reverse is an optional boolean to reverse the comment history from latest -> earliest. Defaults at earliest -> latest.

Get a single comment

n.getComment('http://someblog.com/123', <key>, function (err, comment) {
  if (!err) {
    console.log(comment);
  }
});

Remove a comment

n.removeComment('http://someblog.com/123', '1396755219283', function (err, status) {
  if (!err) {
    console.log('deleted!');
  }
});

Tests

npm test
0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago