Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Blacklist locations on OLX
- // @namespace olxisshit
- // @version 1.0
- // @description Hide offers from certain locations on OLX
- // @author copychef
- // @match https://www.olx.pl/nieruchomosci/mieszkania/*
- // @grant none
- // @require https://gist.github.com/raw/2625891/waitForKeyElements.js
- // ==/UserScript==
- var blacklistedDistricts = ["Białołęka", "Bielany", "Targówek", "Praga-Południe", "Praga-Północ", "Wilanów", "Ursus", "Bemowo"];
- function filterOffer(offer) {
- var localization = $(".bottom-cell span", offer).text();
- var isBlacklisted = blacklistedDistricts.some(function(district) {
- return localization.indexOf(district) >= 0;
- });
- if (isBlacklisted) {
- offer.hide();
- }
- }
- (function() {
- 'use strict';
- waitForKeyElements("#offers_table > tbody > tr.wrap", filterOffer);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement