{"size": 589, "ext": "js", "max_stars_repo_path": "public/modules/core/controllers/home.client.controller.js", "max_stars_repo_name": "Kibo007/tweetsWall", "max_stars_repo_stars_event_min_datetime": "2017-01-22T20:40:54.000Z", "max_stars_repo_stars_event_max_datetime": "2017-01-22T20:40:54.000Z", "max_issues_repo_path": "public/modules/core/controllers/home.client.controller.js", "max_issues_repo_name": "Kibo007/tweetsWall", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/modules/core/controllers/home.client.controller.js", "max_forks_repo_name": "Kibo007/tweetsWall", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.3103448276, "max_line_length": 61, "alphanum_fraction": 0.59762309}

'use strict';

angular.module('core').controller('HomeController',
  [
    '$scope',
    'tweeterSocket',
    function ($scope, tweeterSocket) {
      $scope.twitterData = [];

      var tweetsAppend = function (data) {
        $scope.twitterData.push(data);
      };

      var teetsPrepend = function (data) {
        $scope.twitterData.unshift(data);
      };

      $scope.containMedia = function(media) {
        return !_.isEmpty(media);
      };

      tweeterSocket.on('twitter_feed:new', teetsPrepend);
      tweeterSocket.on('twitter_feed:history', tweetsAppend);
    }
  ]
);

