Return to Snippet

Revision: 39112
at January 13, 2011 16:35 by maynardflies


Initial Code
<SCRIPT LANGUAGE="JavaScript">

var parentwin = external.menuArguments; var doc = parentwin.document;
String.prototype.endsWith = function(str) {return (this.match(str+"$")==str)}
function formatString(mystring)
{
return mystring.substr(18,mystring.length-20);
}
var dubs = 'Dubs:\n';


for (var i=0; i < doc.links.length; i++) {
  var li = doc.links[i];

	if (li.innerText.endsWith('XXX') && li.href.charAt(li.href.length-3) == li.href.charAt(li.href.length-4))
	{
		dubs +='>>'+ formatString(li.href)+'\n';
	}


}

var trips= 'Trips:\n';


for (var i=0; i < doc.links.length; i++) {
  var li = doc.links[i];

	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))
	{
		trips += '>>'+formatString(li.href)+'\n';
	}


}
  alert(dubs+trips);


</script>

Initial URL

                                

Initial Description
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

Initial Title
4Chan Dubs & Trips checker

Initial Tags

                                

Initial Language
JavaScript