Advertisement
Guest User

Untitled

a guest
May 8th, 2011
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name           Hide reputation
  3. // @namespace      theymos.com
  4. // @description    Hides the reputation text on the Bitcoin forum
  5. // @include        *://www.bitcoin.org/smf/index.php*topic*
  6. // @exclude        *://www.bitcoin.org/smf/index.php?board*
  7. // @exclude        *://www.bitcoin.org/smf/index.php
  8. // @exclude        *://www.bitcoin.org/smf/
  9. // @exclude        *://www.bitcoin.org/smf
  10. // ==/UserScript==
  11.  
  12. function getElementsByClass(classname,tag)
  13. {
  14.     var output=new Array();
  15.     var allTags=document.getElementsByTagName(tag);
  16.     for (i in allTags)
  17.     {
  18.         if (allTags[i].className==classname)
  19.         {
  20.             output.push(allTags[i]);
  21.         }
  22.     }
  23.     return output;
  24. }
  25. pattern1=/.*Reputation: \+[0-9]+\/-[0-9]+<br>.*/;
  26. pattern2=/.*<a href=".*modifykarma.*\[ . \].*/g;
  27. alldivs=getElementsByClass("smalltext","div");
  28. if(alldivs.length<400)
  29. {
  30.     for(i in alldivs)
  31.     {
  32.         innerhtml=alldivs[i].innerHTML;
  33.         if(innerhtml.length<4000)
  34.         {
  35.             oldhtml=innerhtml;
  36.             innerhtml=innerhtml.replace(pattern1,"");
  37.             if(innerhtml!=oldhtml)
  38.             {
  39.                 innerhtml=innerhtml.replace(pattern2,"");
  40.                 alldivs[i].innerHTML=innerhtml;
  41.             }
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement