Skip to content

Instantly share code, notes, and snippets.

@mayronceccon
Created February 24, 2023 12:03
Show Gist options
  • Select an option

  • Save mayronceccon/3684d93980ea4ee1448de01063f92397 to your computer and use it in GitHub Desktop.

Select an option

Save mayronceccon/3684d93980ea4ee1448de01063f92397 to your computer and use it in GitHub Desktop.
Linkedin Post Silenciado
// ==UserScript==
// @name Linkedin Post Silenciado
// @description Desabilita os posts com as palavras definidas
// @version 0.1
// @author Mayron Ceccon
// @match https://www.linkedin.com/feed/*
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAudJREFUaEPtml9IU1Ecx793rolo8y/UJFwyRExDIoykSBF9KIJ6KPPFV/cSQU+FE1sNQV8K+gNaDz0ElUZgVHuwtYbUSI2G6BL/TJm2P0FzarUx9y82SoZ3jrMOu9uNex4vv3PO9/P7nt8951wuA/WQBP5cDRBuBxgZ+NDCjB0iPIL4ZzeDLm0vwuErfNDN0sgwfQxUr+y8yTw7y04GqtdhXmb/j2gBIN3uCQ4IDlBmIKkldGRfAW6dqkLtXikmnRu4rJ3B+Nc1Sgl03YkBZLuzYb50AoU5u7ZmdHv9qL49CscPH50Kit7EAMq6MvSfqWFNpXwxjfsTyxQS6LoSA3TUlWEgDkDH8BQefFqhU0HRmxiA90sokqRIEd88WYVamRSTjkgRf8GEbZ0if/RdiR2gnyo1IxADNJYXo7G8iKXCsLQKw5Ir+vy4vBDH5OyYD9ZVvLe6kSvJQsP+IlSW5EEiFsGzGcTKuhf6RRc2fIF/IiQGUDdV4FpTBWuS6/p5qPXz0eeJYhbdHtw5XQ1ptpg1hscfxN2PVqjezCIQSu5wzAnA40k7Wg/KIBYxCbP8bNqB1qempJzgBODXZjC6fEjauSef8dzsJAmNxnACQKwGgM7yHS0Px4m7ZBxApAbyNSOI1AVJ4wzAFwhheOYblte8kBfk4OyBPZBkieJqPNpvxBjhIZETgIj4+gEjTI6NLcGHS/NhVNbHhbgwaMLQlIPEAG5qYHDKgbZB9ttlqO0QztewP0VdfGnGvTFr5gD0GBbQpZtjCeppqURng4L1/OrILPpGLZkDELvZxaraaePrfjsHzbsF/gLsBByPiJMiTtYBASCeVbSHub8HPpIaEBwQHNiWAaGIE+wIwmuU9EqZ9rcQyaW+WVGCZkUxy3CdxRW9qGxvycZT7cREB5M0BBHXQBq0EU0pABClKYVBggMpTC7R0P+BA51aG5hwKRFu5gXZ+P2zB9DLRH+3CeTdQAjtvHEi5neb36ldPQEJ7wjAAAAAAElFTkSuQmCC
// @grant none
// ==/UserScript==
(function() {
'use strict';
const feedSelector = '.feed-shared-update-v2';
const componentSelector = '.update-components-text';
const words = ['layoff']
const regex = RegExp(words.map(word => `.*${word}.*`).join('|'))
function block() {
const stories = document.querySelectorAll(feedSelector);
for (const story of stories) {
if (story.style.display == 'none') {
continue;
}
const descriptions = story.querySelectorAll(componentSelector);
for (const description of descriptions) {
const descriptionContent = description.innerText.trim();
if (regex.test(descriptionContent)) {
story.style.display = 'none';
}
}
}
}
const observer = new MutationObserver(block);
observer.observe(document.body, {
'childList': true,
'subtree': true
});
block();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment