Skip to content

Instantly share code, notes, and snippets.

@rigwild
Last active February 16, 2022 19:49
Show Gist options
  • Save rigwild/219c20d910da72901e20bc10a6f0411a to your computer and use it in GitHub Desktop.
Save rigwild/219c20d910da72901e20bc10a6f0411a to your computer and use it in GitHub Desktop.
Tampermonkey script to remove spam companies from LinkedIn job search page
// ==UserScript==
// @name Remove spam companies
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove spam job postings from LinkedIn job search
// @author rigwild (https://github.com/rigwild)
// @match https://www.linkedin.com/jobs/search*
// @grant none
// ==/UserScript==
// https://gist.github.com/rigwild/219c20d910da72901e20bc10a6f0411a
const blacklist = new Set([
'Technicus.nl',
'Werkzoeken.nl',
'ICTerGezocht.nl',
])
const removeSpam = () => {
const listings = Array.from(document.querySelectorAll('li.jobs-search-results__list-item'))
let count = 0
let spammers = new Set()
listings.forEach(x => {
const content = x.querySelector('a[data-control-name="job_card_company_link"]')
if (content && blacklist.has(content.textContent.trim())) {
x.remove()
spammers.add(content.textContent.trim())
count++
}
})
if (count > 0) console.log(`[Remove spam companies] Removed ${count} spam job postings`, spammers)
}
(async () => {
'use strict';
while (true) {
await new Promise(res => setTimeout(res, 800))
removeSpam()
}
})()
@virgiliu
Copy link

virgiliu commented Dec 2, 2020

Thank you. These neuken companies flooding the job ads with bullshit and there's nothing you can do about it since you can't report accounts.

@rigwild
Copy link
Author

rigwild commented Dec 2, 2020

Thank you. These neuken companies flooding the job ads with bullshit and there's nothing you can do about it since you can't report accounts.

Oh, after searching for it on the internet I felt like I was the only one complaining ahah
this script is not perfect though

@virgiliu
Copy link

virgiliu commented Dec 2, 2020

It does its job well 👍 I just had to adapt it so it can remove the spam from recommendations too

@virgiliu
Copy link

virgiliu commented Dec 3, 2020

Not sure how to make a pull request on a gist, but if you want to remove the spam from recommendations, I put that code in my fork of your script: https://gist.github.com/virgiliu/5f6fc86bb79a3c6d782441167e3ae470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment