BBO Discussion Forums: Anti-matmat script - BBO Discussion Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Anti-matmat script I was bored at work

#1 User is offline   Antrax 

  • PipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,458
  • Joined: 2011-March-15
  • Gender:Male

Posted 2011-June-21, 09:53

For people who use Greasemonkey (an add-on to your browser that lets you write custom scripts to parse web pages. http://www.greasespot.net/), I'm attaching a script that filters out the "Interests" field in people's profiles here. I'm not exactly a web expert and I did this in 10 minutes so there's no option to filter by poster name or to turn it off (other than shutting the script down). But still, if it helps someone else, why not.
function removeInterests()
{
	var user_fields = document.getElementsByClassName("user_fields");
	for (var j = user_fields.length - 1; j >= 0; --j)
	{
  	  var fieldList = user_fields[j].getElementsByTagName("span");
	  for (var i = 0; i < fieldList.length; ++i)
	  {
		  var txt = fieldList[i].textContent;
		  if ("Interests:" == txt)
		  {
			 fieldList[i].parentNode.removeChild(fieldList[i+1]);
			 fieldList[i].parentNode.removeChild(fieldList[i]);
			 break;
		  } 
	  }
	}
}
removeInterests();

11

#2 User is offline   matmat 

  • ded
  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 3,459
  • Joined: 2005-August-11
  • Gender:Not Telling

Posted 2011-June-21, 18:33

Wrong forum!

Belongs here
1

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users