Created
May 31, 2016 12:14
-
-
Save ftp27/269647e43eb0c2298b29f2655ed1b7aa to your computer and use it in GitHub Desktop.
User Script for filtring arenda-piter
This file contains hidden or 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
// ==UserScript== | |
// @name Arenda scanner | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Change transparent blocks by filters | |
// @author ftp27 | |
// @match http://www.arenda-piter.ru/workpage.php* | |
// @grant none | |
// ==/UserScript== | |
$(document).ready(function() { | |
animationDuration = 500; // Время анимации в миллисекундах | |
// Параметры фильтрации | |
minCoast = 15000; // Минимальная цена квартиры в рублях | |
maxCoast = 30000; // Максимальная цена квартиры в рублях | |
// Районы | |
regions = [ | |
"Адмиралтейский", | |
"Центральный", | |
"Василеостровский", | |
]; | |
$(".tbm_01 .tdm_02 .tdm_rn").each(function() { | |
region = this.textContent.split(" ")[0]; | |
if ($.inArray(region,regions) < 0) { | |
$(this).parents(".trm_01,.trm_02").animate({ | |
opacity: 0.3 | |
}, animationDuration); | |
} | |
}); | |
$(".tdm_05").each(function() { | |
coast = parseFloat($(this).html().split("<br>")[0])*1000; | |
if (coast<minCoast || coast>maxCoast) { | |
$(this).parents(".trm_01,.trm_02").animate({ | |
opacity: 0.3 | |
}, animationDuration); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment