Google Image Ripper

By dearcomputer Last update May 13, 2010 — Installed 34,502 times.

A little improvement

in
Subscribe to A little improvement 3 posts, 3 voices



shake User
FirefoxWindows

Hi,

The script is useless without the hyperlink to the page that is hosting it.

Change the regex to:
var fullUrl = fullImgUrls[reversedX].href.match( /\/imgres\?imgurl\=(.*?)\&imgrefurl\=(.*?)\&/ );

and change the IF statement:

if(fullUrl) {

newLink = document.createElement('a');
imgContent.parentNode.insertBefore(newLink , imgContent.nextSibling);
newLink.href = decodeURI(fullUrl[2]);

newLink.style.borderColor = 'White';

newElement = document.createElement('img');
newLink.appendChild(newElement);
newElement.src = decodeURI(fullUrl[1]);
newElement.border = 0;

}
and you have a winner.

I am hidding the blue hyperlink image borders because they bother me. You can remove that bit of code if you want

 
freecyber User
FirefoxWindows

To me, the script was already useful. However this is a great improvement! Thank you! I do not understand why the author would not incorporate this into the official script.

For me, links with a query string did not work until I changed the line "newLink.href = decodeURI(fullUrl[2]);" to "newLink.href = unescape(fullUrl[2]);". I don't know why, since from what I read on the web, decodeURI() should do the same thing as unescape() in this situation (but in fact was doing nothing).

 
dearcomputer Script's Author
FirefoxMacintosh

I've just released an update which includes your idea. Thanks for the suggestion!

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel