<commit_before>var Results = require('../Schemas/result.js').Results;
var Tally = require('../Schemas/tally.js').Tally;
var pubnubPublishKey = process.env.PUBNUB_PUBLISH_KEY || api.PUBNUB_PUBLISH_KEY;
var pubnubSubscribeKey = process.env.PUBNUB_SUBSCRIBE_KEY || api.PUBNUB_SUBSCRIBE_KEY;
var pubnub = require("pubnub")({
  ssl: true, // <- enable TLS Tunneling over TCP
  publish_key: pubnubPublishKey,
  subscribe_key: pubnubSubscribeKey
});
var tally = {
  react: 0,
  angular: 0,
  ember: 0,
  backbone: 0,
  mithril: 0,
  polymer: 0,
  flight: 0,
  capuccino: 0,
  spine: 0,
  aurelia: 0,
  other: 0
};

var tallyResults = function(){
  var db = require('../Schemas/config.js');
  Results.find(function(err, data){
    data.forEach(function(item){
      if(item.repo_data.match(/true/)){
        var curr = JSON.parse(item.repo_data);
        for(var key in curr.libraryCollection){
          if(curr.libraryCollection[key]){
            tally[key]++;
          }
        }
      }
    });
    var today = new Tally({
      tally: JSON.stringify(tally),
      timestamp: new Date()
    });
    today.save(function(err){<commit_msg>added tally to include cappuccino and knockout<commit_after>var Results = require('../Schemas/result.js').Results;
var Tally = require('../Schemas/tally.js').Tally;
var pubnubPublishKey = process.env.PUBNUB_PUBLISH_KEY || api.PUBNUB_PUBLISH_KEY;
var pubnubSubscribeKey = process.env.PUBNUB_SUBSCRIBE_KEY || api.PUBNUB_SUBSCRIBE_KEY;
var pubnub = require("pubnub")({
  ssl: true, // <- enable TLS Tunneling over TCP
  publish_key: pubnubPublishKey,
  subscribe_key: pubnubSubscribeKey
});
var tally = {
  react: 0,
  angular: 0,
  ember: 0,
  backbone: 0,
  mithril: 0,
  polymer: 0,
  flight: 0,
  'objective-j': 0,
  spine: 0,
  knockout: 0,
};

var tallyResults = function(){
  var db = require('../Schemas/config.js');
  Results.find(function(err, data){
    data.forEach(function(item){
      if(item.repo_data.match(/true/)){
        var curr = JSON.parse(item.repo_data);
        for(var key in curr.libraryCollection){
          if(curr.libraryCollection[key]){
            tally[key]++;
          }
        }
      }
    });
    var today = new Tally({
      tally: JSON.stringify(tally),
      timestamp: new Date()
    });
    today.save(function(err){
{'fraction_non_alphanumeric': 0.1454070526774053, 'fraction_numerical': 0.00914235959947758, 'mean_word_length': 3.178181818181818, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1743101', 'n_tokens_mistral': 877, 'n_tokens_neox': 831, 'n_words': 165}