Created
June 12, 2012 19:51
-
-
Save panSarin/2919740 to your computer and use it in GitHub Desktop.
userscript for euro2012 spam in facebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Euro2012 antyspam | |
| // @author pan_sarin | |
| // @description Script for replacing euro2012 facebook content into not so annoying content | |
| // @version 0.0.3 | |
| // @include http://www.facebook.com/* | |
| // @include https://www.facebook.com/* | |
| // @todo user definied content ( links / images ) or more random dummy content from some rss | |
| // ==/UserScript== | |
| var replace_spam = function(){ | |
| var spans = document.body.getElementsByTagName('span'); | |
| var my_regexp = /([Ee]uro|[Ss]muda|[Mm]ecz|[Pp]ol(sk[ia]|a[cy|ków])|[Kk]oko)/ | |
| if (spans) | |
| { | |
| for (var i in spans) | |
| { | |
| if (spans[i].innerHTML && my_regexp.test(spans[i].innerHTML)) | |
| { | |
| spans[i].innerHTML = 'Zostaw ten internet - nie znajdziesz tu nic mądrego'; | |
| } | |
| } | |
| } | |
| } | |
| replace_spam(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment