Skip to content

Instantly share code, notes, and snippets.


nparsons08/enrichment.js Secret

Created Nov 8, 2019
What would you like to do?
// instantiate a new client (server side)
var streamClient = stream.connect(,;
// instantiate a feed using feed class 'timeline_flat' and user id from params
var timelineFlatFeed = streamClient.feed('timeline_flat', params.user_id);
// get activities from stream
.then(function(stream) {
// length of activity results
var ln = stream.results.length;
// exit if length is zero
if (!ln) {
return next();
// enrich the activities
var references = streamUtils.referencesFromActivities(stream.results);
streamUtils.loadReferencedObjects(references, params.user_id, function(referencedObjects) {
streamUtils.enrichActivities(stream.results, referencedObjects);
cb(null, stream.results);
.catch(function(error) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.