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
{"items": [ | |
{ | |
"verb": "post", // Id which maps to specification submitted to activity streams registrar | |
"postedTime": "2010-12-12T12:12:12Z", | |
"title": "Plain Text", | |
"summary": "Plain Text", // Have not decided on plain text only | |
"permalinkUrl": "...", | |
"to": [{"id" : "acct:john.doe@example.org"}], // We should use person constructs here | |
"cc": [{"id":"acct:jane.doe@example.org"}], | |
"bcc": [{"id":"acct:jean.deux@example.org"}], |
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
User.hasMany("bugs", Bug, "creatorId"); | |
Bug.belongsTo("user", User, "creatorId"); | |
Project.hasMany("bugs", Bug, "projectId"); | |
Bug.belongsTo("project", Project, "projectId"); | |
User.hasMany("commits", Commit, "creatorId"); | |
Commit.belongsTo("user", User, "creatorId"); | |
Project.hasMany("commits", Commit, "projectId"); |
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
// https://github.com/ciberch/activity-streams-mongoose | |
Activity.find().sort('published', 'descending').limit(10).run( | |
function (err, docs) { | |
var activities = []; | |
if (!err && docs) { | |
activities = docs; | |
res.render('index', {activities: activities}); | |
} | |
}); |
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 redis = require("redis"); | |
var publisher = redis.createClient(options.redis.port, options.redis.host); | |
if(options.redis.pass) { | |
publisher.auth(options.redis.pass); | |
} | |
function publish(streamName, activity) { | |
activity.save(function(err) { | |
if (!_.isArray(activity.streams)) { | |
activity.streams = [] |
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 streamLib = require('activity-streams-mongoose')({ | |
mongoUrl: app.siteConf.mongoUrl, | |
redis: app.siteConf.redisOptions, | |
defaultActor: defaultAvatar | |
}); | |
var authentication = new require('./authentication.js')(streamLib, app.siteConf); | |
// Moved normalization to only be done on pre save | |
streamLib.types.UserSchema.pre('save', function (next) { |
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 im = require('imagemagick'); | |
var Guid = require('guid'); | |
var siteConf = require('./lib/getConfig'); | |
var lib = new require('./lib/asms-client.js')(app, cf).streamLib; | |
function ingestPhoto(req, res, next){ | |
if (req.files.image) { | |
im.identify(req.files.image.path, function(err, features){ | |
if (features && features.width) { | |
var guid = Guid.create(); |
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 getDistinct = function (req, res, next, term, init){ | |
var key = 'used.' + term; | |
req[key] = init ? init : []; | |
var query = {streams: req.session.desiredStream}; | |
asmsDB.Activity.distinct(term, query, function(err, docs) { | |
if (!err && docs) { | |
_.each(docs, function(result){ | |
req[key].push(result); | |
}); | |
next(); |
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 im = require('imagemagick'); | |
var Guid = require('guid'); | |
function reducePhoto(req, res, next){ | |
var photoIngested = req.photosUploaded['original']; | |
if (photoIngested) { | |
var sizeName = sizes[req.nextSizeIndex].name; | |
var destPath = photoIngested.metadata.path + '-' + sizeName ; | |
var nameParts = photoIngested.metadata.filename.split('.'); | |
var newName = nameParts[0] + '-' + sizeName + '.' + nameParts[1]; |
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 LocationHash = { | |
displayName: {type: String}, | |
position: { | |
latitude: Number, | |
longitude: Number | |
} | |
}; | |
var ActivityObjectHash = { | |
id: {type: String}, |
OlderNewer