malygos / Deal Labs Maly

// ==UserScript==
// @name         Deal Labs Maly
// @include      *www.dealabs.com/?maly*
// @require     https://openuserjs.org/install/malygos/COMMON.user.js
// ==/UserScript==

var min_deal = parseInt(window.location.search.slice(5));

if ( !Number.isInteger(min_deal)){
    min_deal = 0;
    console.log("No Very hot deal minumum value defined")
}
else
    console.log("Very hot deal minumum value of "+min_deal)
            
$('.mouai').remove();

$('#body>aside').remove();
$('.expired').remove();
//$('.body_pagination').remove();

//pas de deal en magasin
while ($('a:contains("En magasin")').eq(0).length){

    $('a:contains("En magasin")').eq(0).parents().eq(2).remove();
}

function tag_hot_deals(){
    var deal_temps = $('.temperature_div>p')
    for (var i=0; i<deal_temps.length; i++){
        if(deal_temps.eq(i).text().replace('°', '').trim() >=min_deal)
            deal_temps.eq(i).addClass('vhot');
    }
    
}
tag_hot_deals();

while ($('.temperature_div>p:not(.vhot)').length){
    $('.temperature_div>p:not(.vhot)').eq(0).parents().eq(5).remove();
}

var descr_comments = $('.content_div_deal_index>div:not(:nth-child(1))');
for (var i=0; i<descr_comments.length; i++){
    descr_comments.eq(i).remove();
}