I'm trying to build something akin to Facebook's "Share" functionality for my website.
I've gotten to the point where I can accept a URL, scrape it for meta keywords and suitably get titles/descriptions, but I'm a bit stuck as to the best way to determine 'likely' photos the user may want to share.
I currently use the SimpleXMLElement to turn the page into a traversable DOM, and find all the tags, turning them into absolute URLs. After that, I'm not sure how I can go about finding a suitable thumbnail.
Do I download them all, and go by file size? Do I use some sort of heuristic like, "was encountered in the middle of the page"?
Does anyone else have any recommendations, suggestions, or tips?