Skip to content

Instantly share code, notes, and snippets.

@beanmoss
Last active July 17, 2017 13:53
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beanmoss/91f8631269b8182bf6f2 to your computer and use it in GitHub Desktop.
Save beanmoss/91f8631269b8182bf6f2 to your computer and use it in GitHub Desktop.
pangchurva ng aldub, pastillas, otwol sa facebook!

FUN WITH BOOKMARKLET AND JS

  • Replaces anything that mentions 'aldub', 'pastillas' and 'otwol' with 'IDONTFUCKINGCARE' in facebook.
  • Only works on your view with a click of a button.
  • Doesnt work with fb mobile app. You can try it with your mobile browser though.

Updates

  • 17-09-17: Adjustments to dom class name
  • 22-09-15: You can now input keywords to filter :)
  • 21-09-15: Totally removes the effin dom!

How to?

  1. Chrome, FF, Opera: Open any website(google.com) in a new tab.
  2. Bookmark that website.
  3. Give it a cool name like (IDONTFUCKINGCARE).
  4. Hit save.
  5. If you see that new bookmarklet button/link on your browsers bookmark's tab, right click on it and click edit.
  6. Replace everything in the URL textbox with the content in IDONTFUCKINGCARE bookmarklet file below(the one that starts with javascript)
  7. Hit save.
  8. Open your facebook account.
  9. Test this by visiting aldub/pastillas or otwol fb pages.
  10. If you're on the page, hit the mofo IDONTFUCKINGCARE bookmark button/link you set.
  11. You can even click that while browsing your feeds or timeline.
  12. TLDR. O<- potato for u.

WARNING: Slows down your fb

feel free to fork/enhance/convert to chrome extension.

javascript:(function()%7BMutationObserver%20%3D%20window.MutationObserver%20%7C%7C%20window.WebKitMutationObserver%3Bfilter%20%3D%20prompt(%22Dont%20want%20to%20see%20these%3A%22%2C%20%22aldub%7Cpastillas%7Cotwol%22)%3BiDontFuckingCare()%3Bvar%20observer%20%3D%20new%20MutationObserver(function%20(mutations%2C%20observer)%20%7BiDontFuckingCare()%3B%7D)%3Bobserver.observe(document%2C%20%7Bsubtree%3A%20true%2Cattributes%3A%20true%7D)%3Bfunction%20iDontFuckingCare()%20%7Bif%20(filter%20!%3D%20null)%20%7Bx%20%3D%20document.getElementsByClassName('fbUserContent')%3BregexFilter%20%3D%20new%20RegExp(filter%2C%20%22gi%22)%3Bfor%20(var%20i%20%3D%200%3B%20i%20%3C%20x.length%3B%20i%2B%2B)%20%7Bif%20(regexFilter.test(x%5Bi%5D.innerHTML))x%5Bi%5D.remove()%3B%7D%7D%7D%7D)()
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
filter = prompt("Dont want to see these:", "aldub|pastillas|otwol");
iDontFuckingCare();
var observer = new MutationObserver(function (mutations, observer) {
iDontFuckingCare();
});
observer.observe(document, {
subtree: true,
attributes: true
});
function iDontFuckingCare() {
if (filter != null) {
x = document.getElementsByClassName('fbUserContent');
regexFilter = new RegExp(filter, "gi");
for (var i = 0; i < x.length; i++) {
if (regexFilter.test(x[i].innerHTML))x[i].remove();
}
}
}
@bezhermoso
Copy link

@beanmoss
Copy link
Author

haha! tua ra!!

@junibrosas
Copy link

mangtasa sir!!!

@co0kie
Copy link

co0kie commented Oct 1, 2015

@beanmoss: hello pwede pa update code mo pare. hahaha buang!

MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
filter = prompt("Di nako ni sila feel:", "aldub|pastillas|otwol|hasht5");
iDontFuckingCare();
var observer = new MutationObserver(function (mutations, observer) {
    iDontFuckingCare();
});
observer.observe(document, {
    subtree: true,
    attributes: true
});
function iDontFuckingCare() {
    if (filter != null) {
        x = document.getElementsByClassName('userContentWrapper');
        regexFilter = new RegExp(filter, "gi");
        for (var i = 0; i < x.length; i++) {
            if (regexFilter.test(x[i].innerHTML))x[i].remove();
        }
    }
}

@beanmoss
Copy link
Author

beanmoss commented Oct 1, 2015

Kelangan yan ng unit test pare.. haha. Pasensya na.. buang

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