<commit_before>/**
 * Created by JBH on 2015/3/2
 * Controller
 */

var mongodb = require('./../config/db'),
	markdown = require('markdown').markdown;

var ObjectID = require('mongodb').ObjectID;

//Get model
var Post = require('./../models/post');

module.exports = Post;

/**
 * Post articles
 * @param callback
 */

Post.prototype.save = function(callback){

	var date = new Date();
	var time = {
		date: date,
		year: date.getFullYear(),
		month: date.getFullYear() + "-" + (date.getMonth() + 1),
		day: date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(),
		minute: date.getFullYear() + "-" + (date.getMonth() + 1) + "-" +  date.getDate() + " " + 
			date.getHours() + ":" + (date.getMinutes() < 10 ? '0' + 
					date.getMinutes() : date.getMinutes())
	};
	var post = {
		name: this.name,
		head: this.head,
		times: time,
		title: this.title,
		tags: this.tags,
		post: this.post,
		comments: [],
		reprint_info: {},
		pv: 0
	};
	//open database<commit_msg>update post_controller.js<commit_after>/**
 * Created by JBH on 2015/3/2
 * Controller
 */

var mongodb = require('./../config/db'),
	markdown = require('markdown').markdown;

var ObjectID = require('mongodb').ObjectID;

//Get model
var Post = require('./../models/post');

module.exports = Post;

/**
 * Post articles
 * @param callback
 */

Post.prototype.save = function(callback){

	var date = new Date();
	var time = {
		date: date,
		year: date.getFullYear(),
		month: date.getFullYear() + "-" + (date.getMonth() + 1),
		day: date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(),
		minute: date.getFullYear() + "-" + (date.getMonth() + 1) + "-" +  date.getDate() + " " + 
			date.getHours() + ":" + (date.getMinutes() < 10 ? '0' + 
					date.getMinutes() : date.getMinutes())
	};
	var post = {
		name: this.name,
		head: this.head,
		time: time,
		title: this.title,
		tags: this.tags,
		post: this.post,
		comments: [],
		reprint_info: {},
		pv: 0
	};
	//open database
{'fraction_non_alphanumeric': 0.2109256449165402, 'fraction_numerical': 0.013151239251390997, 'mean_word_length': 3.146750524109015, 'pattern_counts': {'":': 2, '<': 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': '5806410', 'n_tokens_mistral': 798, 'n_tokens_neox': 723, 'n_words': 156}