<commit_before>var mongoose = require('mongoose');
var Post = mongoose.model('Post');

module.exports = function(System) {
  var obj = {};
  var json = System.plugins.JSON;
  var sck = System.webSocket;

  /**
   * Get activities for a user
   * @param  {Object} req The request object
   * @param  {Object} res The response object
   * @return {Void}
   */
  obj.feed = function(req, res) {
    //TODO: pagination
    var userId = req.params.userId;
    var criteria = { creator: userId };
    Post.find(criteria, null, {sort: {created: -1}}).populate('creator').populate('post').exec(function(err, posts) {
      if (err) {
        json.unhappy(err, res);
      } else {
        json.happy({
          records: posts<commit_msg>Fixed typos<commit_after>var mongoose = require('mongoose');
var Activity = mongoose.model('Activity');

module.exports = function(System) {
  var obj = {};
  var json = System.plugins.JSON;
  var sck = System.webSocket;

  /**
   * Get activities for a user
   * @param  {Object} req The request object
   * @param  {Object} res The response object
   * @return {Void}
   */
  obj.feed = function(req, res) {
    //TODO: pagination
    var userId = req.params.userId;
    var criteria = { creator: userId };
    Activity.find(criteria, null, {sort: {created: -1}}).populate('creator').populate('post').exec(function(err, posts) {
      if (err) {
        json.unhappy(err, res);
      } else {
        json.happy({
          records: posts
{'fraction_non_alphanumeric': 0.14965986394557823, 'fraction_numerical': 0.0013605442176870747, 'mean_word_length': 2.9331550802139037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5444509', 'n_tokens_mistral': 473, 'n_tokens_neox': 480, 'n_words': 122}