opengraph
opengraph copied to clipboard
Google+ image
Google+ uses the to get a thumbnail from sites and facebook also added to their code so it would be great to use this meta tag also. And most of the site stopped using the link rel='image_src' (The New York Times too) so now I think it's unnecessary.
I changed that part to this:
if (!isset($page->values['image'])) {
$domxpath = new DOMXPath($doc);
$elements = $domxpath->query("//meta[@itemprop='image']");
if ($elements->length > 0) {
$domattr = $elements->item(0)->attributes->getNamedItem('content');
if ($domattr) {
$page->_values['image'] = $domattr->value;
$page->_values['image_src'] = $domattr->value;
}
}
}
I also tried to creat an automatic image finder but I got in truble with that.