Activity Streams Engine using MongoDB(Mongoose odm) and Redis
npm install activity-streams-mongooseActivity Streams is a simple specification used to describe social actions around the web. http://activitystrea.ms
This library provides the following Activity Stream Models on Mongoose:
* ActivityObject
* Activity
For details on the properties each see pne of the following specifications:
* http://activitystrea.ms/specs/json/1.0/
* http://opensocial-resources.googlecode.com/svn/spec/2.0/Social-Data.xml#ActivityEntry
``javascript`
var mongoose = require('mongoose');
mongoose.connect(siteConf.mongoUrl);
var asmsDB = require('activity-streams-mongoose')(mongoose);
`javascript
var cf = new asmsDB.ActivityObject({displayName: "Cloud Foundry" , url: "http://www.cloudfoundry.com"});
cf.save(function (err) {
//...
}
});
`
`javascript
var testAct = new asmsDB.Activity({title: "Started the app", target: target._id});
testAct.save(function (err) {
//...
});
`
Asking for the latest 5:
`javascript
asmsDB.getActivityStream(5, function (err, docs) {
docs.forEach(function(doc){console.log(doc);});
});
``