private function getOpenGraph(): array {
        $results = array();

        $nodes = $this->article()->getDoc()->find('meta[property^="og:"]');

        foreach ($nodes as $node) {
            $property = explode(':', $node->attr('property'));
            array_shift($property);
            $results[implode(':', $property)] = $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'));
                array_shift($property);
                $results[implode(':', $property)] = $node->attr('content');
            }
        }

        return $results;
    }
private function getOpenGraph(): array {
        $results = array();

        $nodes = $this->article()->getDoc()->find('meta[property^="og:"]');

        foreach ($nodes as $node) {
            $property = explode(':', $node->attr('property'));
            array_shift($property);
            $results[implode(':', $property)] = $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'));
                array_shift($property);
                $results[implode(':', $property)] = $node->attr('content');
            }
        }

        return $results;
    }
private function getOpenGraph ( ) : array { $ results = array ( ) ; $ nodes = $ this -> article ( ) -> getDoc ( ) -> find ( 'meta[property^="og:"]' ) ; foreach ( $ nodes as $ node ) { $ property = explode ( ':' , $ node -> attr ( 'property' ) ) ; array_shift ( $ property ) ; $ results [ implode ( ':' , $ property ) ] = $ 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' ) ) ; array_shift ( $ property ) ; $ results [ implode ( ':' , $ property ) ] = $ node -> attr ( 'content' ) ; } } return $ results ; }
Retrieve all OpenGraph meta data

Ported from python-goose https://github.com/grangier/python-goose/ by Xavier Grangier

@return string[]
Retrieve all OpenGraph meta data