I've posted a url into a feed I've created on my homeserver to get all meta data of that url off a website.
The website I've scraped is uk.yahoo.com. I have posted that very link knowing that it infact has an og: meta for that page under that very url.
<meta property="og:image" content="https://s.yimg.com/dh/ap/default/130909/y_200_a.png">
<meta name="description" content="News, email....">
<meta property="og:title" content="Yahoo">
yet when I look at my console it says the array is empty
libxml_use_internal_errors(true); //
$doc = new DomDocument();
$doc->loadHTML($html);
$xpath = new DOMXPath($doc);
$query = '//*/meta[starts-with(@property, \'og:\')]';
$metas = $xpath->query($query);
$rmetas = array();
foreach($metas as $meta) {
$property = $meta->getAttribute('property');
$content = $meta->getAttribute('content');
$rmetas[$property] = $content;
}
var_dump($rmetas);
I then post a news.yahoo.com link and it gets all the og: meta perfect.