<commit_before>// ==UserScript==
// @name        Srednia cena ogladanych aukcji
// @namespace   http://github.com/zaza
// @include     http://allegro.pl/listing/*
// @version     0.1
// @grant       none
// ==/UserScript==

var prices = []
var spans = document.getElementsByClassName('bid dist')
for (var i = 0; i < spans.length; i++) {
    var price = spans[i].childNodes[2].nodeValue
    price = price.replace(/\s+/g, '');
    prices.push(parseFloat(price))
}

var sum = 0;
for (var i = 0; i < prices.length; i++){
    sum += prices[i];
}

var avg = sum/prices.length;

document.getElementById('main-breadcrumb-search-hits').innerHTML += " srednia="+avg;

<commit_msg>as self-executing function<commit_after>// ==UserScript==
// @name        Allegro - Srednia cena ogladanych aukcji
// @namespace   http://github.com/zaza
// @include     http://allegro.pl/listing/*
// @version     0.2
// @grant       none
// ==/UserScript==

(function() {
var prices = []
var spans = document.getElementsByClassName('bid dist')
for (var i = 0; i < spans.length; i++) {
    var price = spans[i].childNodes[2].nodeValue
    price = price.replace(/\s+/g, '');
    prices.push(parseFloat(price))
}

var sum = 0;
for (var i = 0; i < prices.length; i++){
    sum += prices[i];
}

var avg = sum/prices.length;
avg = Number((avg).toFixed(2))

if (!isNaN(avg))
	document.getElementById('main-breadcrumb-search-hits').innerHTML += " Å›rednia="+avg;
})();


{'fraction_non_alphanumeric': 0.19330076762037685, 'fraction_numerical': 0.009071877180739707, 'mean_word_length': 3.2052785923753664, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7617857', 'n_tokens_mistral': 528, 'n_tokens_neox': 513, 'n_words': 112}