This packages helps you to detect and read Open Graphs
tags in any html page.
You can install the package via composer:
composer require beebmx/og-reader
For validate a page with or without Open Graph
tags:
use Beebmx\OgReader\ContentReader;
$reader = ContentReader::load('https://website.com');
$reader->meta()->hasOg();
$reader->meta()->notHasOg();
If you need all the meta tags in the page:
use Beebmx\OgReader\ContentReader;
$reader = ContentReader::load('https://website.com');
$reader->meta();
If you only need the Open Graph
tags:
use Beebmx\OgReader\ContentReader;
$reader = ContentReader::load('https://website.com');
$reader->meta()->og();
Each tag can be access like an object:
$tag->property;
$tag->content;
If you need the tag representation as HTML just:
$tag->asHtml();
composer test
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.