Goose\Modules\Extractors\MetaExtractor::getOpenGraph PHP Method

getOpenGraph() private method

Ported from python-goose https://github.com/grangier/python-goose/ by Xavier Grangier
private getOpenGraph ( ) : string[]
return string[]
    private function getOpenGraph()
    {
        $results = array();
        $nodes = $this->article()->getDoc()->find('meta[property^="og:"]');
        foreach ($nodes as $node) {
            $property = explode(':', $node->attr('property'));
            $results[$property[1]] = $node->attr('content');
        }
        // Additionally retrieve type values based on provided og:type (http://ogp.me/#types)
        if (isset($results['type'])) {
            $nodes = $this->article()->getDoc()->find('meta[property^="' . $results['type'] . ':"]');
            foreach ($nodes as $node) {
                $property = explode(':', $node->attr('property'));
                $results[$property[1]] = $node->attr('content');
            }
        }
        return $results;
    }