Stavo finendo un progetto da consegnare oggi pomeriggio quando mi ritrovo a dover inviare temporaneamente un immagine su ImageShack.

Invio il file correttamente e.. puff! non mi permette di avere l'indirizzo dell'immagine in scala 1:1.

Controllando meglio, mi sono accorto che l'indirizzo in realtà è hardcoded nel codice HTML... e allora perchè non prenderlo? :-)

Ho sviluppato al volo questo bookmarklet pronto per esser utilizzato finchè non si faranno furbi e non cambieranno metodo per nascondere l'indirizzo!
Per gli smanettoni il codice JavaScript è il seguente

((window.location.host.match(/^(.*\.|)imageshack.us$/)||window.location.hostname.match(/^(.*\.|)imageshack.us$/))?function(){var CDNisLinks=$('input[disabled=disabled][readonly=readonly][class=readonly][wrap=off]');var CDNisLinksString="";CDNisLinks.each(function(i){CDNisLinksString +='<a href="'+CDNisLinks[i].value+'" title="Target Link" target="_blank">Click here to leech the image</a>';});if(!$('#coolminds_wrapper').length){$('body').prepend('<div id="coolminds_wrapper" style="line-height: 30px;border:1px solid #cab985;background-color:orange;"><h1><a href="http://www.coolminds.org" title="Coolminds" target="_blank">Coolminds Developers Network</a><br />ImageShack Direct Links Grabber</h1><p>'+((!CDNisLinks.length)?'No images found.':CDNisLinksString)+'<p></div>');}}() : alert('Warning: you can use this bookmarklet only when you\'re on imageshack.us'))




I was finishing a project that has to be delivered today when I get needing of having an image on a remote online server like ImageShack.

So I correctly sent the file and... puff! It doesn't allow me to get the 1:1 scale image's URL.
By checking a while, I found the URL hardcoded on the HTML code... so, why don't take it? :-)

I on-fly developed this bookmarklet ready to be used to catch the targets link until they get smart and they change the url hiding method!
For nerds, JavaScript code is here

((window.location.host.match(/^(.*\.|)imageshack.us$/)||window.location.hostname.match(/^(.*\.|)imageshack.us$/))?function(){var CDNisLinks=$('input[disabled=disabled][readonly=readonly][class=readonly][wrap=off]');var CDNisLinksString="";CDNisLinks.each(function(i){CDNisLinksString +='<a href="'+CDNisLinks[i].value+'" title="Target Link" target="_blank">Click here to leech the image</a>';});if(!$('#coolminds_wrapper').length){$('body').prepend('<div id="coolminds_wrapper" style="line-height: 30px;border:1px solid #cab985;background-color:orange;"><h1><a href="http://www.coolminds.org" title="Coolminds" target="_blank">Coolminds Developers Network</a><br />ImageShack Direct Links Grabber</h1><p>'+((!CDNisLinks.length)?'No images found.':CDNisLinksString)+'<p></div>');}}() : alert('Warning: you can use this bookmarklet only when you\'re on imageshack.us'))

0 commenti:

Posta un commento

Visualizzazioni totali