Skip to content

Instantly share code, notes, and snippets.

[test]: Update test/* files
[dist]: Changes to submodules, version bumps, updates to package.json
[minor]: Small changes
[doc]: Updates to documentation
[fix]: Bug fixes
[bin]: Update binary scripts associated with the project
[refactor]: Refactor of existing code
[nit]: Small code review changes mainly around style or syntax
[feat]: New features
@pedrolopesme
pedrolopesme / youtube_peacemaker.js
Created February 21, 2023 18:31
Remove Youtube suggestions based on a word list
const words = ["lula", "bolsonaro"]
let peaceMaker = function() {
suggestions = document.getElementsByTagName('ytd-rich-item-renderer');
for (let i = 0; i < suggestions.length; i++) {
substrings = suggestions[i].getElementsByTagName('yt-formatted-string');
for (let ii = 0; ii < substrings.length; ii++) {
text = substrings[ii].textContent;
if(words.some(function(v) { return text.toLowerCase().indexOf(v) >= 0; })){
suggestions[i].remove();