<commit_before>(function (env) {
    "use strict";
    env.ddg_spice_arxiv = function(api_result){

        if (!api_result) {
            return Spice.failed('arxiv');
        }

        Spice.add({
            id: "arxiv",

            name: "Reference",
            data: api_result,
            meta: {
                sourceName: "arxiv.org",
                sourceUrl: api_result.feed.entry.link[0].href
            },
            normalize: function(item) {
                return {
                    title: item.feed.entry.title.text,
                    url: item.feed.entry.link[0].href,
                    subtitle: item.feed.entry.author.map( function(e) {
                        return e.name.text;
                    } ).join(', '),
                    description: item.feed.entry.summary.text
                };
            },
            templates: {
                group: 'info',
                options: {
                    moreAt: true
                }
            }
        });
    };
}(this));
<commit_msg>Add published year to title<commit_after>(function (env) {
    "use strict";
    env.ddg_spice_arxiv = function(api_result){

        if (!api_result) {
            return Spice.failed('arxiv');
        }

        Spice.add({
            id: "arxiv",

            name: "Reference",
            data: api_result,
            meta: {
                sourceName: "arxiv.org",
                sourceUrl: api_result.feed.entry.link[0].href
            },
            normalize: function(item) {
                return {
                    title: sprintf( "%s (%s)",
                        item.feed.entry.title.text,
                        item.feed.entry.published.text.replace( /^(\d{4}).*/, "$1" )
                    ),
                    url: item.feed.entry.link[0].href,
                    subtitle: item.feed.entry.author.map( function(e) {
                        return e.name.text;
                    } ).join(', '),
                    description: item.feed.entry.summary.text
                };
            },
            templates: {
                group: 'info',
                options: {
                    moreAt: true
                }
            }
        });
    };
}(this));

{'fraction_non_alphanumeric': 0.12544642857142857, 'fraction_numerical': 0.0026785714285714286, 'mean_word_length': 1.0080645161290323, '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': '633969', 'n_tokens_mistral': 627, 'n_tokens_neox': 574, 'n_words': 98}