I'd guess they're displaying Twitter messages on the page, and trying to filter 
portions of the message, replacing bad words with something else.
-Eric
On Thu, Aug 19, 2010 at 12:49 PM, Scott Williams 
<<[email protected]>[email protected]> wrote:
Looking at our filter today I noticed a pornography hit on a webpage.
it was<http://msnbc.msn.com> msnbc.msn.com , I thought maybe my filter company 
was making a political statement, but looking a little closer, the link took me 
to this page<http://www.msnbc.msn.com/id/33589610> 
http://www.msnbc.msn.com/id/33589610
a segment of it is below. Can someone explain this filterProfanity thing and 
why a legitimate site would purposely put it into their code? Maybe I can learn 
something.
filterProfanity(tweet){ var badwords = 
["shit","piss","fuck","cunt","cocksucker","motherfucker","tits"].join("|"); var 
filter = new RegExp(badwords,"gi"); var m = tweet.match(filter); if(m){ for(var 
i=0;i"; if(showLinks=="true"){ var charLimit = 37; var m = 
item.text.match(/((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%...@!\-\/]))?/gi);
 // 
/((https?\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%...@!\-\/]))?/gi
 // /(((https?\:\/\/)|(www\.))[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/gi if(m){ 
for(var i=0;i<http://www.msnbc.msn.com/id/%5C%22%22+m%5Bi%5D+%22%5C%22>"+ ( 
(m[i].length > charLimit) ? (m[i].substring(0,charLimit)+"…") : m[i] ) +""); 
if(m[i].indexOf("www")==0){ item.text = item.text.replace(m[i],<> 
"http://"+m[i]); } } }; if(item.text.search(/@\w+/) > -1) { item.text = 
item.text.replace(/(^|\s)@(\w+)/g, "$1@<http://twitter.com/$2>$2"); } 
if(item.text.search(/(^|\s)#(\w+)/g) > -1) { item.text = 
item.text.replace(/(^|\s)#(\w+)/g, 
"$1<http://search.twitter.com/search?q=%23$2>#$2"); } } 
if(showProfanity=="false"){ item.text =
-- 
Scott R. Williams

Fisher School District
801 S . 5th St.
Fisher, Il 61843





| Subscription info at<http://www.tech-geeks.org> http://www.tech-geeks.org |
--
Eric Barringer
Technology Coordinator
Blue Ridge CUSD #18

| Subscription info at http://www.tech-geeks.org |

Reply via email to