Last active
March 1, 2021 18:42
-
-
Save kiwec/6a09e5df37006b150ee8b79f8a55d17e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code de QUALITÉ (issou) | |
// picunroll avant de lancer le script bien entendu | |
var arr = []; | |
$('.conteneur-message').each(function(){ | |
var name = $(this).find('.text-user').text().trim(); | |
// HACK nettoyage du message | |
$(this).find('a').remove(); | |
$(this).find('blockquote').remove(); | |
$(this).find('.signature-msg').remove(); | |
$(this).find('.info-edition-msg').remove(); | |
var text = $(this).find('.bloc-contenu').text(); | |
// x chiffres + optionellement un séparateur + 3 chiffres ou + | |
// Tout montant > 100$ ok | |
var re = /(\d+)\D?(\d{3,})/g; | |
var matches = re.exec(text); | |
if(!matches) return; | |
var val = parseInt((matches[1] + "" + matches[2]), 10); | |
if(!val || isNaN(val)) return; | |
if(arr[val]) | |
arr[val].push(name); | |
else | |
arr[val] = [name]; | |
}); | |
for(var i in arr) { | |
if(!arr.hasOwnProperty(i)) continue; | |
document.getElementById('message_topic').value += '* ' + i + '$ : ' + arr[i].join(', ') + '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MaJ : suppression des blocs "message edit le..." qui trigger le regex avec "2021"