LinkedIn Clear Spam

Filters out companies from job listings.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         LinkedIn Clear Spam
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Filters out companies from job listings.
// @author       You
// @match        https://www.linkedin.com/jobs/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=linkedin.com
// @grant        GM.setValue
// @grant        GM.getValue
// @license      MIT
// ==/UserScript==

const delay = (ms) => {
  return new Promise((res) => setTimeout(res, ms));
};

const regexItems = [
    'brown & brown insurance',
    'dice',
    'lumen',
    'crypto',
    'TechTalent Squared',
    'Talentify.io',
    'SynergisticIT',
    'national general',
    'patterned learning ai',
    'get it recruit',
    'remoteworker us',
    'csc generation',
    'actalent',
    'piper companies',
    'braintrust',
    'cybercoders',
    'angi',
    'iboss',
    'oowlish',
    'kula\\.ai',
    'jobot',
    'motion recruitment',
    'cybercoder'
];

const regex = new RegExp(regexItems.join('|'), 'gim');

const filterResults = async () => {
  const list = document.querySelector(".jobs-search-results-list");

  for (let i = 0; i <= 6; ++i) {
    list.scroll(0, 500 * i);

    const results = document.querySelectorAll(
      ".jobs-search-results-list .scaffold-layout__list-container > li"
    );
    results.forEach((result, i) => {
      if (result.innerText.match(regex)) {
        result.remove();
        return;
      }

      if (result.innerText.match(/promoted/gim)) {
        result.remove();
        return;
      }
    });

    await delay(350);
  }

  const buttons = document.querySelectorAll(".artdeco-pagination__pages li");

  buttons.forEach((button) => {
    button.addEventListener("click", (event) => {
      delay(350).then(() => {
          console.log('BEANS')
        filterResults();
      });
    });
  });

  list.scroll(0, 0);
};

(async () => {
  await delay(1500);

  await filterResults();
})();