Given a URL how do I pull the largest image (in terms of image-dimensions) on the site? I am using it to act as the best possible representation of a sites thumbnail.
Similar to first thumbnail image when sharing a url on Facebook:
http://www.facebook.com/share.php?u=my_website_url
The image thumbnail on Facebook in the div:
<div class="UIThumbPager_Thumbs">
Current code (using Javascript and JQuery):
else if (item.link) historyHtml += '<a href=' + item.link + ' class="image" target="_blank"><img src="*SITE THUMBNAIL HERE*" width="111px"></a>';
Please note, the user will be logged in to Facebook and will be able to access that site thumbnail.
You can’t do it on the client-side (i.e., with JavaScript) due to cross-domain restrictions. You’d need to download the contents of the URL on the back end first. See here: http://en.wikipedia.org/wiki/Same_origin_policy