activity

Activity Manager for any kind of statuses based on ids

##Activity

Activity Manager for any kind of statuses based on ids

npm install activity --save-dev
var Activity = require('activity');
 
var activity = new Activity({
  statuses: ["online", "offline", "away"]
});
activity.setStatus('uid1', 'online', function(err){
  if (err) {
    // somthing went wrong 
  }
});
 
// you can set an status without checking if it was applied 
activity.setStatus('uid2', 'away');
activity.setStatus('uid3', 'online');
activity.getStatus(['uid1', 'uid2'], function(errstatuses){
  if (err) {
    // somthing went wrong 
  }
  else {
    console.dir(statuses); // { uid1: 'online', uid2: 'away' } 
  }
});
activity.getStatus('uid1', function(errstatus){
  if (err) {
    // somthing went wrong 
  }
  else {
    console.dir(status); // 'online' 
  }
});
activity.getIds('online', function(errids){
  if (err) {
    // somthing went wrong 
  }
  else {
    console.dir(ids); // [ 'uid1', 'uid3' ] 
  }
});
  • Add option to use Redis to store the current statuses.
  • A way to clear all ids.
  1. Fork this repo
  2. run npm install
  3. Create the tests for the new functionality or bug case
  4. Put your awesome code
  5. run grunt test
  6. All good?, place a pull request