<commit_before>
var _         = require('underscore')
, Faker       = require('Faker')
, Screen_Name = require('../Screen_Name/model').Screen_Name
, Website     = require('../Website/model').Website
, Folder      = require('../Folder/model').Folder
;

exports.route = function (mod) {

  var OK = mod.app;
  var app = mod.app;

  app.get('/me/:screen_name', function (req, resp, next) {
    var OK     = mod.New_Request(req, resp, next);
    var r      = mod.New_River(req, resp, next);
    var data   = null;
    var uni    = 0;

    r.job(function (j) {
      Screen_Name.read_by_screen_name(req.params.screen_name, j);
    })
    .job(function (j, last) {
      if (!last)
        return next();
      Website.read_by_screen_name_id(last.data.id, j);
    })
    .job(function (j, last) {
      if (!last || !last.length)
        return next();
      uni = last[0];
      data            = OK.template_data('Screen_Name/me')
      data['title']   = uni.data.title || req.params.screen_name;
      Folder.read({website_id: uni.data.id}, j)
    })
    .job(function (j, last) {
      data['folders'] = last;
      OK.render_template();
    })
    .run();
  });


  // ================================================================
  // =============== CREATE =========================================
  // ================================================================

  OK.post('/me', function (req, resp, next) {
    var OK = mod.New_Request(arguments);
    OK.json_success("Created.", {screen_name: req.body.screen_name});
  });

  // ================================================================
  // =============== UPDATE =========================================
  // ================================================================

  OK.put('/screen_names/:name', function (req, resp, next) {<commit_msg>Removed: screen name creation scaffolding.<commit_after>
var _         = require('underscore')
, Faker       = require('Faker')
, Screen_Name = require('../Screen_Name/model').Screen_Name
, Website     = require('../Website/model').Website
, Folder      = require('../Folder/model').Folder
;

exports.route = function (mod) {

  var OK = mod.app;
  var app = mod.app;

  app.get('/me/:screen_name', function (req, resp, next) {
    var OK     = mod.New_Request(req, resp, next);
    var r      = mod.New_River(req, resp, next);
    var data   = null;
    var uni    = 0;

    r.job(function (j) {
      Screen_Name.read_by_screen_name(req.params.screen_name, j);
    })
    .job(function (j, last) {
      if (!last)
        return next();
      Website.read_by_screen_name_id(last.data.id, j);
    })
    .job(function (j, last) {
      if (!last || !last.length)
        return next();
      uni = last[0];
      data            = OK.template_data('Screen_Name/me')
      data['title']   = uni.data.title || req.params.screen_name;
      Folder.read({website_id: uni.data.id}, j)
    })
    .job(function (j, last) {
      data['folders'] = last;
      OK.render_template();
    })
    .run();
  });


  // ================================================================
  // =============== CREATE =========================================
  // ================================================================

  OK.post('/me', function (req, resp, next) {
    var OK = mod.New_Request(arguments);
    var r = mod.New_River(req, resp, next);
    var c = req.user;
    c.new_data = {screen_name: req.body.screen_name};
    r.job(function (j) {
      Screen_Name.create(c, j);
    })
    .job(function (j, last) {
      OK.json_success("Created.", {screen_name: req.body.screen_name});
    })
    .run();
  });

  // ================================================================
  // =============== UPDATE =========================================
  // ================================================================

  OK.put('/screen_names/:name', function (req, resp, next) {
{'fraction_non_alphanumeric': 0.33128520225294417, 'fraction_numerical': 0.0010240655401945725, 'mean_word_length': 3.0910994764397905, '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': '2856881', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1133, 'n_words': 217}