This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Don't copy over history | |
user1.follow('user', '2', { limit: 0 }); | |
// Copy over a maximum of 300 activities | |
user1.follow('user', '3', { limit: 300 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = stream.connect('API_KEY', 'API_SECRET', 'APP_ID', { expireTokens: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = stream.connect('API_KEY', 'API_SECRET'), | |
user1 = client.feed('user','1'); | |
user1.follow('user', '2') | |
.then(function(body) { | |
return user1.get({ limit: 1 }); | |
}) | |
.then(function(body) { | |
console.log(body); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var follows = [ | |
{'source': 'flat:1', 'target': 'user:1'}, | |
{'source': 'flat:1', 'target': 'user:2'}, | |
{'source': 'flat:1', 'target': 'user:3'} | |
]; | |
client.followMany(follows) | |
.then(function(body) { /* fulfillment handler */ }) | |
.catch(function(error) { /* rejection handler */ }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var activity = {'actor': 'User:1', 'verb': 'tweet', 'object': 'Tweet:1'}; | |
var feeds = ['flat:1','flat:2','aggregated:3']; | |
client.addToMany(activity, feeds) | |
.then(function(body) { /* fulfillment handler */ }) | |
.catch(function(error) { /* rejection handler */ }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"streamApiSecret": "", | |
"public" : { | |
"streamApiKey": "", | |
"streamApiAppId": "" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New users news feed follow his own user feed | |
Stream.feedManager.followUser(user._id, user._id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! this.isSimulation && loc && loc.coords) | |
activity.place = getLocationPlace(loc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global subscriptions | |
if (Meteor.isClient) { | |
Meteor.subscribe('news'); | |
Meteor.subscribe('bookmarkCounts'); | |
feedSubscription = Meteor.subscribe('Stream.feeds.flat'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('equals', function(a1, a2) { | |
return a1 === a2; | |
}); |
OlderNewer