meatspace

Decentralized micro[b]logging

Meatspace

Decentralized micrologging. A lightweight module to manage mini posts through your node app.

Install redis.

> brew install redis

> redis-server
{
    id: 1,
    fullName: 'Edna Piranha',
    postUrl: 'http://url/to/this/meatspace.com',
    content: {
        created: 1368383147,
        updated: 1368383147,
        message: 'some message',
        urls: [
            {
                title: 'some url',
                url: 'http://some.url.com'
            }
        ]
    },
    meta: {
        location: '37.3882807, -122.0828559',
        isPrivate': false
    }
}
var Meatspace = require('meatspace');

var meat = new Meatspace({
  fullName: 'Edna Piranha',
  postUrl: 'http://meatspace.generalgoods.net',
  db: 0
});

db is the Redis database you are using.

var message = {
  content: {
    message: 'some message',
    urls: [
      {
        title: 'some url',
        url: 'http://some.url.com'
      }
    ]
  },
  meta: {
    location: '37.3882807, -122.0828559',
    isPrivate: false
  }
};

meat.create(message, function (err, m) {
  if (!err) {
    console.log(m);
  }
});
meat.get(1, function (err, m) {
  if (!err) {
    m.content.message = 'new updated message';
    meat.update(m, function (err, m) {
      if (!err) {
        console.log(m)
      }
    });
  }
});
meat.get(1, function (err, m) {
  if (!err) {
    meat.del(m.id, function (err, status) {
      if (status) {
        console.log('deleted!')
      }
    });
  }
});
meat.getAll(function (err, messages) {
  if (!err) {
    console.log(messages);
  }
});

The default limit is set to 10. You can change this by setting meat.limit = 15 as an example.

meat.shareRecent(function (err, messages) {
  if (!err) {
    console.log(messages);
  }
});
meat.shareOne(1, function (err, message) {
  if (!err) {
    console.log(message);
  }
});