Skip to content

Instantly share code, notes, and snippets.

@ftp27
Created May 31, 2016 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ftp27/269647e43eb0c2298b29f2655ed1b7aa to your computer and use it in GitHub Desktop.
Save ftp27/269647e43eb0c2298b29f2655ed1b7aa to your computer and use it in GitHub Desktop.
User Script for filtring arenda-piter
// ==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