LinkedIn filter

Filter jobs based on title, company and places

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         LinkedIn filter
// @description  Filter jobs based on title, company and places
// @version      1.0
// @license      MIT
// @author       robertozanaboni
// @match        *://www.linkedin.com/*
// @grant        none
// @namespace https://greasyfork.org/users/99415
// ==/UserScript==
(function () {
    // Configuration starts
    var desiredTitles = []; // e.g. ['front end', 'ui engineer']
    var undesiredTitles = []; // e.g. ['full stack', 'manager']
    var desiredCompanies = []; // e.g. ['Tesla', 'SpaceX']
    var undesiredCompanies = []; // e.g. ['Facebook', 'Amazon']
    var undesideredPlaces = []; // e.g. ['Roma', 'Milano']
    // Configuration ends
    var debugMode = false;
    var desiredTitlesRegEx = new RegExp(desiredTitles.join('|'), 'i');
    var undesiredTitlesRegEx = new RegExp(undesiredTitles.join('|'), 'i');
    var desiredCompaniesRegEx = new RegExp(desiredCompanies.join('|'), 'i');
    var undesiredCompaniesRegEx = new RegExp(undesiredCompanies.join('|'), 'i');
    var undesiredLuogoRegEx = new RegExp(undesideredPlaces.join('|'), 'i');
    var jobTileSelector = 'li.artdeco-list__item';
    var jobTileTitleSelector = '.job-card-list__title';
    var jobCompanySelector = '.job-card-container__company-name';
    var jobCardSelector = 'li.card-list__item';
    var jobLuogoSelector = 'li.job-card-container__metadata-item';
        var jobCarouselCardSelector = 'li.jobs-search-results__list-item';
    var jobCardTitleSelector = '.job-card-square__title';
    var ghostCompanySelector = '.ghost-company';
    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(jobCardSelector + ", " + jobCarouselCardSelector + ", " + jobTileSelector)
                            .forEach(function (job) {
                            var title = job.querySelector(jobCardTitleSelector + ", " + jobTileTitleSelector);
                            var company = job.querySelector("" + jobCompanySelector);
                            var luogo = job.querySelector("" + jobLuogoSelector);

                            var ghostCompany = !!job.querySelector(ghostCompanySelector);
                            if (title &&
                                company &&
                                luogo &&
                                (ghostCompany ||
                                    (desiredTitles.length &&
                                        !desiredTitlesRegEx.test(title.textContent)) ||
                                    (undesiredTitles.length &&
                                        undesiredTitlesRegEx.test(title.textContent)) ||
                                 (undesideredPlaces.length &&
                                        undesiredLuogoRegEx.test(luogo.textContent)) ||
                                    (desiredCompanies.length &&
                                        !desiredCompaniesRegEx.test(company.textContent)) ||
                                    (undesiredCompanies.length &&
                                        undesiredCompaniesRegEx.test(company.textContent)))) {
                                if (debugMode) {
                                    job.style.border = 'solid red';
                                }
                                else {
                                    job.remove();
                                }
                            }
                        });
                    }
                });
            });
        });
    }).observe(document.body, { childList: true, subtree: true });
})();