<commit_before>/**
 * io route
 *
 */

var models = require("../models");

var admin = require("./admin");
var sources = require("./sources");

module.exports = function () {
  var io = this;

  admin.call(io);
  sources.twitter.call(io, "#ggjsap", "A1");

  // // load sources
  // models.Source.find({
  //   type: "tweet"
  // }).exec().then(function (source) {
  //   return models.Channel.find({
  //     source: source
  //   }).populate("source");
  // }).then(function (channels) {
  //   console.log(channel);
  //   sources.twitter.call(io, channel.source.url, channel.name);
  // });

  // set offline
  models.Screen.update({}, {
    status: "offline"
  }).exec();

  io.on("connection", function (socket) {<commit_msg>Fix screen management<commit_after>/**
 * io route
 *
 */

var models = require("../models");

var admin = require("./admin");
var sources = require("./sources");

module.exports = function () {
  var io = this;

  admin.call(io);
  sources.twitter.call(io, "#ggjsap", "A1");

  // // load sources
  // models.Source.find({
  //   type: "tweet"
  // }).exec().then(function (source) {
  //   return models.Channel.find({
  //     source: source
  //   }).populate("source");
  // }).then(function (channels) {
  //   console.log(channel);
  //   sources.twitter.call(io, channel.source.url, channel.name);
  // });

  // set offline
  models.Screen.find().exec().then(function (screens) {
    screens.forEach(function (screen) {
      screen.status = "offline";
      screen.save();
    });
  });

  io.on("connection", function (socket) {
{'fraction_non_alphanumeric': 0.21656050955414013, 'fraction_numerical': 0.0012738853503184713, 'mean_word_length': 2.7227488151658767, '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': '4684622', 'n_tokens_mistral': 527, 'n_tokens_neox': 517, 'n_words': 101}