philmageo
Filtering Bots by ranking
If you are a developper or curious you can easily add features to Lichess.orgI have just stumbled across Scripty, a Chrome extension that runs some scripts on websites.
For instance, I like to play occasionaly a Lichess bot but the list is long and many bots are too strong for me.
So I have made a little script that hides bots that are not in the rapid range of 1000 to 1500.
I have installed Scripty (you'll find it on the Chrome Store) and added the script to it.
Now, every time I go on the bot page, I only see the Bots that interest me :)
Here is the script :
(function () {
if(window.location.pathname !== '/player/bots') return;
const minScore = 1000;
const maxScore = 1500;
const title = document.querySelectorAll('h1.box__top');
if(title){
title[0].innerHTML = 'My Bots filtered from ' + minScore + ' to ' + maxScore
}
const iconType = '';
const elementList = document.querySelectorAll('.bots__list .bots__list__entry');
elementList
.forEach((x) => {
let rating = x.querySelector('.bots__list__entry__rating');
let ratingSpans = rating.querySelectorAll('span');
let foundRapidScore = false;
ratingSpans.forEach((y) => {
let ratingType = y.getAttribute('data-icon');
if(ratingType === iconType){
let score = parseInt(y.innerHTML);
if(!isNaN(score)){
foundRapidScore = true;
if(score > maxScore || score < minScore){
x.style.display = 'none'
}
}
}
})
if(!foundRapidScore){
x.style.display = 'none'
}
});
})();
Cheers