<commit_before>$(function()
{
    socket = io.connect('https://api.misskey.xyz:1207/streaming/home', { port: 1207 });

    socket.on('connected', function()
    {
        console.log('Connected');
    });

    socket.on('disconnect', function(client)
    {
    });

    socket.on('post', function(content)
    {
        console.log(content);
        var $post = TIMELINE.generatePostElement(content, conf).hide()
        TIMELINE.setEventPost($post);
        $post.prependTo($('#timeline > .timeline > .posts')).show(200);
    });

    $('#postForm').submit(function(event)
    {
        event.preventDefault();
        var $form = $(this);
        var $submitButton = $form.find('[type=submit]');

        $submitButton.attr('disabled', true);
        $submitButton.text('Updating...');

        $.ajax($form.attr('action'), {
            type: $form.attr('method'),
            processData: false,
            contentType: false,
            data: new FormData($form[0]),
            dataType: 'json',
            xhrFields: {
                withCredentials: true
            }
        }).done(function(data)
        {
            $form[0].reset();
            $submitButton.attr('disabled', false);
            $submitButton.text('Update');
        }).fail(function(data)
        {
            $form[0].reset();
            /*alert('error');*/
            $submitButton.attr('disabled', false);
            $submitButton.text('Update');
        });
    });
});
<commit_msg>Display relative time<commit_after>$(function()
{
    socket = io.connect('https://api.misskey.xyz:1207/streaming/home', { port: 1207 });

    socket.on('connected', function()
    {
        console.log('Connected');
    });

    socket.on('disconnect', function(client)
    {
    });

    socket.on('post', function(content)
    {
        console.log(content);
        var $post = TIMELINE.generatePostElement(content, conf).hide()
        TIMELINE.setEventPost($post);
        $post.prependTo($('#timeline > .timeline > .posts')).show(200);
    });

    $('#postForm').submit(function(event)
    {
        event.preventDefault();
        var $form = $(this);
        var $submitButton = $form.find('[type=submit]');

        $submitButton.attr('disabled', true);
        $submitButton.text('Updating...');

        $.ajax($form.attr('action'), {
            type: $form.attr('method'),
            processData: false,
            contentType: false,
            data: new FormData($form[0]),
            dataType: 'json',
            xhrFields: {
                withCredentials: true
            }
        }).done(function(data)
        {
            $form[0].reset();
            $submitButton.attr('disabled', false);
            $submitButton.text('Update');
        }).fail(function(data)
        {
            $form[0].reset();
            /*alert('error');*/
            $submitButton.attr('disabled', false);
            $submitButton.text('Update');
        });
    });

    setInterval(function() {
		var now = new Date();
		$('time').each(function() {
			function pad2(n) { return n < 10 ? '0' + n : n }
			var date = new Date($(this).attr('datetime').replace(/\-/g, "/"));
			var ago = ~~((now - date) / 1000);
			var timeText =
				ago >= 31536000 ? ~~(ago / 31536000) + "年前":
				ago >= 2592000 ? ~~(ago / 2592000) + "ヶ月前":
				ago >= 604800 ? ~~(ago / 604800) + "週間前":
				ago >= 86400 ? ~~(ago / 86400) + "日前":
				ago >= 3600 ? ~~(ago / 3600) + "時間前":
				ago >= 60 ? ~~(ago / 60) + "分前":
				ago >= 5 ? ~~(ago % 60) + "秒前":
				ago < 5 ? 'いま' : "" ;
			$(this).text(timeText);
		});
	}, 1000);
});

{'fraction_non_alphanumeric': 0.1952712100139082, 'fraction_numerical': 0.03004172461752434, 'mean_word_length': 2.0526315789473686, 'pattern_counts': {'":': 7, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 2, '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': '240024', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1119, 'n_words': 183}