img2html Bookmarklet

The img2html bookmarklet below helps you to get a html source code with a <img> element which refers photo sharing service, ex. Yahoo's Flickr, Google's Picasa Web Album, etc.

You can also try just to click the link above for testing on the site.
It generates HTML source code like below:

<a href="Page URL" target="_blank" title="Page Title"><img src="Image URL" width="Image Width" height="Image Height" border="0" alt="Image ALT" /></a>

The largest image on page is picked up by the bookmarklet.
This works on flickr.

Also works on Picasa Web Album and any other websites.

Source (kawanet.blogspot.com)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%28function%28%29%7Bvar%20x%3D240%3Bvar%20y%3D80%3Bvar%20c%3Dwindow.img2html_history%3Bif%28%21c%29%7Bc%3D%7B%7D%3Bwindow.img2html_history%3Dc%3B%7Dvar%20a%3Ddocument.getElementsByTagName%28%27img%27%29%3Bvar%20p%3D0%3Bvar%20g%3Bfor%28var%20i%3D0%3Bi%3Ca.length%3Bi++%29%7Bvar%20tg%3Da%5Bi%5D%3Bif%28%21tg.src%29continue%3Bif%28c%5Btg.src%5D%29continue%3Bvar%20tp%3Dtg.width*tg.height%3Bif%28p%3E%3Dtp%29continue%3Bp%3Dtp%3Bg%3Dtg%3B%7Dvar%20b%3Ddocument.body%3Bvar%20w%3Db.style%3Bvar%20o%3Dwindow.img2html_last%3Bif%28o%26%26%21g%29%7Bw.marginTop%3D%270%27%3Bwindow.img2html_history%3D%7B%7D%3B%7Dif%28o%26%26o.parentNode%29%7Bo.parentNode.removeChild%28o%29%3B%7Dif%28%21g%29return%3Bc%5Bg.src%5D%3Dtrue%3Bvar%20l%3Dlocation.href.replace%28/%22/g%2C%27%26quot%3B%27%29.replace%28/%23%24/%2C%27%27%29%3Bvar%20n%3Ddocument.title.replace%28/%26/g%2C%27%26amp%3B%27%29.replace%28/%3C/g%2C%27%26lt%3B%27%29.replace%28/%3E/g%2C%27%26gt%3B%27%29.replace%28/%22/g%2C%27%26quot%3B%27%29%3Bvar%20z%3D%27%27%3Bif%28g.alt%29%7Bz%3Dg.alt.replace%28/%26/g%2C%27%26amp%3B%27%29.replace%28/%3C/g%2C%27%26lt%3B%27%29.replace%28/%3E/g%2C%27%26gt%3B%27%29.replace%28/%22/g%2C%27%26quot%3B%27%29%3Bz%3D%27alt%3D%22%27+z+%27%22%20%27%3B%7Dvar%20h%3D%27%3Ca%20href%3D%22%27+l+%27%22%20target%3D%22_blank%22%20title%3D%22%27+n+%27%22%3E%3Cimg%20src%3D%22%27+g.src+%27%22%20width%3D%22%27+g.width+%27%22%20height%3D%22%27+g.height+%27%22%20border%3D%220%22%20%27+z+%27/%3E%3C/a%3E%27%3Bvar%20d%3Ddocument.createElement%28%27div%27%29%3Bvar%20u%3Dd.style%3Bu.padding%3D%274px%20120px%202px%204px%27%3Bu.background%3D%27%23FFFF99%27%3Bu.margin%3D%27-%27+%28y+1%29+%27px%200%200%200%27%3Bu.height%3D%28y-6%29+%27px%27%3Bu.position%3D%27relative%27%3Bu.borderBottom%3D%271px%20solid%20black%27%3Bvar%20m%3Ddocument.createElement%28%27img%27%29%3Bm.src%3Dg.src%3Bvar%20v%3Dm.style%3Bv.position%3D%27absolute%27%3Bv.top%3D%270%27%3Bv.right%3D%270%27%3Bv.float%3D%27right%27%3Bv.padding%3D%270%27%3Bv.margin%3D%270%27%3Bv.background%3D%27%23FFFFFF%27%3Bv.borderLeft%3D%271px%20solid%20black%27%3Bm.alt%3Dg.alt%3Bm.title%3Ddocument.title%3Bvar%20t%3Ddocument.createElement%28%27textarea%27%29%3Bt.value%3Dh%3Bvar%20s%3Dt.style%3Bs.background%3D%27%23FFFF99%27%3Bs.border%3D%270%27%3Bs.wordBreak%3D%27break-all%27%3Bs.fontSize%3D%2718px%27%3Bs.lineHeight%3D%2718px%27%3Bs.width%3D%27100%25%27%3Bs.padding%3D%270%27%3Bs.margin%3D%270%27%3Bs.overflow%3D%27hidden%27%3Bs.fontFamily%3D%27monospace%27%3Bs.height%3D%28y-6%29+%27px%27%3Bd.appendChild%28m%29%3Bd.appendChild%28t%29%3Bb.insertBefore%28d%2Cb.firstChild%29%3Bw.marginTop%3D%28y+1%29+%27px%27%3Bif%28m.height%3Cy%26%26m.width%3Cx%29%7Bv.height%3Dm.height+%27px%27%3B%7Delse%7Bv.height%3Dy+%27px%27%3Bif%28m.clientWidth%3Ex%29%7Bv.width%3Dx+%27px%27%3Bv.height%3D%27%27%3B%7D%7Dvar%20q%3DMath.floor%28%28y-m.clientHeight%29/2%29%3Bvar%20f%3Dy-m.clientHeight-q%3Bvar%20r%3DMath.floor%28%28y-m.clientWidth%29/2%29%3Bif%28r%3C0%29r%3D0%3Bv.padding%3Dq+%27px%20%27+r+%27px%20%27+f+%27px%20%27+r+%27px%27%3Bu.paddingRight%3DMath.floor%28m.clientWidth+4%29+%27px%27%3Bwindow.scrollTo%280%2C0%29%3Bt.select%28%29%3Bt.focus%28%29%3Bwindow.img2html_last%3Dd%3B%7D%29%28%29


Rate it:


Tags:

Comments

Comments so far. Add yours.