<commit_before><commit_msg>Add web console script export_alexa-country-top50.js<commit_after>// Fetch csv data for alexa country top web page
// Example page https://www.alexa.com/topsites/countries/CN

if (!String.prototype.removeLineFeed) {
    String.prototype.removeLineFeed = function() {
        return this.replace(/(\r\n|\n|\r)/gm,"");
    };
}


a=[];
row=document.querySelectorAll('.site-listing');

row.forEach(function (e) {
    _div_rank = e.querySelector('.number');
    _div_name = e.querySelector('.DescriptionCell').querySelector('a');
    _s = _div_rank.innerText.removeLineFeed() + ', ' + _div_name.innerText.removeLineFeed() + ', ';

    _arr_div_right = e.querySelectorAll('.right');
    _arr_div_right.forEach(function (_e) {
        _s += _e.innerText.removeLineFeed() + ', ';
    });

    a.push(_s);
})


var hiddenElement = document.createElement('a');
var textToSave = "";
a.forEach(function (i) { textToSave += i + '\n'; })

hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
hiddenElement.target = '_blank';
hiddenElement.download = 'Alexa_country_top50.csv';
hiddenElement.click();
// HTML5 JS variable saving
// Credit to https://stackoverflow.com/a/24898081

{'fraction_non_alphanumeric': 0.1695616211745244, 'fraction_numerical': 0.010752688172043012, 'mean_word_length': 4.307017543859649, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6986623', 'n_tokens_mistral': 407, 'n_tokens_neox': 396, 'n_words': 66}