All pastes #1342706 Raw Edit

image-ification

public javascript v1 · immutable
#1342706 ·published 2009-02-20 09:05 UTC
rendered paste body
<script type="text/javascript"><!--// image-ification javascript by nuckfuts// last updated 2009-02-20var xpath = "//a[contains(@href,'imageshack')]|//a[contains(@href,'photobucket')]|//a[contains(@href,'whatimg')]";var candidates = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);for (var cand = null, i = 0; (thisCandidate = candidates.snapshotItem(i)); i++) {	var directimageshackus = thisCandidate.href.match(/http\:\/\/img\d*\.imageshack\.us\/img\d*\/\d*\/\w*\.(?:jpg|png|gif|jpeg)/);	var directphotobucket = thisCandidate.href.match(/http\:\/\/i\d*\.photobucket\.com\/albums\/\w*\/\w*\/[\w-]*\.(?:jpg|png|gif|jpeg)/);	var directphotobucketalbum = thisCandidate.href.match(/http\:\/\/i\d*\.photobucket\.com\/albums\/\w*\/\w*\/\w*\/[\w-]*\.(?:jpg|png|gif|jpeg)/);	var directwhatimg = thisCandidate.href.match(/http\:\/\/whatimg\.com\/images\/\w*\.(?:jpg|png|gif|jpeg)/);	if (directimageshackus || directphotobucket || directphotobucketalbum || directwhatimg) {		var div = document.createElement("div");		var img = document.createElement("img");		img.setAttribute("src",thisCandidate.href);		div.appendChild(img);		candidates.snapshotItem(i).parentNode.replaceChild(div, thisCandidate);		NcodeImageResizer.createOn(img);	}}//--></script>