LinkedIn Clear Spam

Filters out companies from job listings.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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();
})();