4Chan Dubs & Trips checker


/ Published in: JavaScript
Save to your folder(s)

This is designed to be an IE Context Menu Script. Save this code to a .htm file, and link to it in the MenuExt registry key. More info at http://msdn.microsoft.com/en-us/library/aa753589(v=vs.85).aspx


Copy this code and paste it in your HTML
  1. <SCRIPT LANGUAGE="JavaScript">
  2.  
  3. var parentwin = external.menuArguments; var doc = parentwin.document;
  4. String.prototype.endsWith = function(str) {return (this.match(str+"$")==str)}
  5. function formatString(mystring)
  6. {
  7. return mystring.substr(18,mystring.length-20);
  8. }
  9. var dubs = 'Dubs:\n';
  10.  
  11.  
  12. for (var i=0; i < doc.links.length; i++) {
  13. var li = doc.links[i];
  14.  
  15. if (li.innerText.endsWith('XXX') && li.href.charAt(li.href.length-3) == li.href.charAt(li.href.length-4))
  16. {
  17. dubs +='>>'+ formatString(li.href)+'\n';
  18. }
  19.  
  20.  
  21. }
  22.  
  23. var trips= 'Trips:\n';
  24.  
  25.  
  26. for (var i=0; i < doc.links.length; i++) {
  27. var li = doc.links[i];
  28.  
  29. if (li.innerText.endsWith('XXX') && li.href.charAt(li.href.length-3) == li.href.charAt(li.href.length-4) && li.href.charAt(li.href.length-4) == li.href.charAt(li.href.length-5))
  30. {
  31. trips += '>>'+formatString(li.href)+'\n';
  32. }
  33.  
  34.  
  35. }
  36. alert(dubs+trips);
  37.  
  38.  
  39. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.