<commit_before>import { clearStyles } from '../util';

export default function () {
    let jews = {};
    var news_article = document.createElement('div');
    news_article.innerHTML = document.getElementById('articles_detail').innerHTML.split('<!-- news1_bottom_468*60 -->')[0].trim();
    [].slice.call(news_article.getElementsByTagName('iframe')).forEach(function (v) {v.remove()});

    var news_info = document.querySelector('.info').textContent.trim().split('|');
    jews.title = document.querySelector('h2').textContent.trim();
    jews.subtitle = document.querySelector('.title').textContent.trim().split('\n')[1].trim();
    jews.content = (function () {
        return clearStyles(news_article).innerHTML;
    })();
    jews.timestamp = (function() {
        var time_info = news_info[1].trim();
        return {
            created: new Date(time_info.replace(/\./g,'/').replace(/[^0-9\/\:\s]/g, '').trim()),
            lastModified: undefined
        };
    })();
    jews.reporters = (function(){
        var reporters = news_info[0].trim().replace(/\(.+\)/, '').trim();
        var matches = clearStyles(news_article).innerHTML.match(/[a-z0-9_]+@/);
        return [{
            name: reporters.split(','),
            mail: matches[0] ? matches[0] : undefined
        }];
    })();
    return jews;
}
<commit_msg>뉴스1 수리<commit_after>import $ from 'jquery';
import { clearStyles } from '../util';

export default function () {
    let jews = {};
    var headline = $('div.title');
    var content = $('#articles_detail')[0].cloneNode(true);

    jews.title = $('h2', headline).text();
    jews.subtitle = $('h3', headline).text().replace(/\n/g, '<br>');
    jews.content = (function () {
        return clearStyles(content).innerHTML;
    })();
    jews.timestamp = (function() {
        return {
            created: new Date($('div.info', headline).text().split('|')[1].replace(' 송고', '').replace(/\./g, '/').replace(' ', 'T').replace(/\s+/g, '')+'+0900'),
            lastModified: undefined
        };
    })();
    jews.reporters = (function(){
        var reporters = $('div.info', headline).text().split('|')[0].replace(/\(.+?\)/, '').split(', ');
        var result = [];
        for (var x in reporters) {
            result.push({
                name: reporters[x],
                mail: undefined
            });
        }
        return result;
    })();
    return jews;
}

{'fraction_non_alphanumeric': 0.2153846153846154, 'fraction_numerical': 0.011226611226611227, 'mean_word_length': 2.6126126126126126, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5731031', 'n_tokens_mistral': 757, 'n_tokens_neox': 751, 'n_words': 127}