MrSS Aggregator is a package that provides aggregation over DDP for MrSS Feeds.
This package provides a local collection with a schema that reflects the Google Feed API so that entries can be aggregated. In conjunction with MrSS Feeds feeds can be collected in a common format that still utilizes all of Meteor's DDP goodness.
Note: This is a very early version of the package and is also my first attempt at creating a package for Meteor so there will be bugs.
Add it to your project:
meteor add tixpaul:mrss-aggregator
Basic example:
shared/mrss-aggregator.js
//New aggregator with our local mongo collection name
//feeds is an array with each feed to aggregate
// name: some name to identify them by
// ddpUrl: The connection with websocket that DDP will connect through
// feedTable: The mongo collection name to Aggregate
MrSSAggregator = new MrSS.Aggregator('ddp_aggregate_two', {
feeds: [
{name: 'telescope-example-1', ddpUrl: 'http://telescope-mrss-feed-1.meteor.com/', feedTable: 'telescope_feed'},
{name: 'telescope-example-2', ddpUrl: 'http://telescope-mrss-feed-2.meteor.com/', feedTable: 'telescope_feed'}
]
});
//A helper so that we can iterate through the posts in a view
if(Meteor.isClient){
Template.feed.helpers({
feedItem: function(){
return MrSSAggregator.getCollection().find({}, {
sort: {publishedAt: -1}
});
}
});
}
Live Examples:
Feed1 Example: http://telescope-mrss-feed-1.meteor.com/
Feed2 Example: http://telescope-mrss-feed-2.meteor.com/
(Unstyled) Aggregator Example: http://mrss-aggregator-example.meteor.com/