LinkedIn jobs filter

Filter jobs based on title and company

As of 2020-08-27. See the latest version.

// ==UserScript==
// @name         LinkedIn jobs filter
// @description  Filter jobs based on title and company
// @namespace    https://greasyforks.org/en/users/673321-christianmemije
// @version      0.1.0
// @license      MIT
// @author       christianmemije
// @match        *://www.linkedin.com/*
// @grant        none
// @supportURL   https://github.com/christianmemije/jobfilters
// ==/UserScript==
(function () {
    var debugMode = false;
    var goodTitles = /frontend|front-end|front end|ui engineer|user interface|web/i;
    var badTitles = /remote/i;
    var badCompanies = /Optello|Jobot|Jobs Interviewing Now from|The Phoenix Group|Amazon|Facebook|Stealth Startup|Intelletec/i;
    // Selectors will probably have to be constantly updated
    var job = 'li.artdeco-list__item';
    var jobTitle = '.job-card-list__title';
    var jobCompany = '.job-card-container__company-name';
    var card = 'li.card-list__item';
    var carouseCard = 'li.artdeco-carousel__item';
    var cardTitle = '.job-card-square__title';
    new MutationObserver(function (mutationRecords) {
        setTimeout(function () {
            mutationRecords.forEach(function (_a) {
                var addedNodes = _a.addedNodes;
                addedNodes.forEach(function (_a) {
                    var nodeType = _a.nodeType;
                    if (nodeType === Node.ELEMENT_NODE) {
                        document
                            .querySelectorAll(card + ", " + carouseCard + ", " + job)
                            .forEach(function (li) {
                            var title = li.querySelector(cardTitle + ", " + jobTitle);
                            var company = li.querySelector("" + jobCompany);
                            var trashCompany = !!li.querySelector('.ghost-company');
                            if (title &&
                                company &&
                                (trashCompany ||
                                    !goodTitles.test(title.textContent) ||
                                    badTitles.test(title.textContent) ||
                                    badCompanies.test(company.textContent))) {
                                if (debugMode) {
                                    li.style.border = 'solid red';
                                }
                                else {
                                    li.remove();
                                }
                            }
                        });
                    }
                });
            });
        });
    }).observe(document.body, { childList: true, subtree: true });
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。