LinkedIn Job Search Result Filter

Filter out LinkedIn job search result by title, company, and location. Edit filter list in the script before use, and keep a backup before updating script.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         LinkedIn Job Search Result Filter
// @namespace    https://greasyfork.org/en/users/85671-jcunews
// @version      1.0.2
// @license      GNU AGPLv3
// @author       jcunews
// @description  Filter out LinkedIn job search result by title, company, and location. Edit filter list in the script before use, and keep a backup before updating script.
// @match        https://www.linkedin.com/search/*
// @grant        none
// ==/UserScript==

((titleFilter, companyFilter, locationFilter) => {

  //===== CONFIGURATION BEGIN =====

  titleFilter    = /badpost|badjob/i;
  companyFilter  = /badcompany|badcorp/i;
  locationFilter = /badcity|badcity, ch|, ch/i;

  //===== CONFIGURATION END =====

  function checkItem(ele, a) {
    if (
      ((a = ele.querySelector(".entity-result__title-text--black,.job-card-list__title")) && titleFilter.test(a.textContent)) ||
      ((a = ele.querySelector(".entity-result__primary-subtitle,.job-card-container__company-name")) && companyFilter.test(a.textContent)) ||
      ((a = ele.querySelector(".entity-result__secondary-subtitle,.job-card-container__metadata-item")) && locationFilter.test(a.textContent))
    ) ele.remove();
  }

  (new MutationObserver(rs => {
    rs.forEach(r => {
      r.addedNodes.forEach(n => {
        if (n.nodeType !== Node.ELEMENT_NODE) return;
        if (n.matches("li.reusable-search__result-container,.jobs-search-results__list-item")) {
          checkItem(n);
        } else document.querySelectorAll("li.reusable-search__result-container,.jobs-search-results__list-item").forEach(li => checkItem(li));
      });
    });
  })).observe(document.body, {childList: true, subtree: true});
})();