beebmx / og-reader
Read OG meta tags
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/beebmx/og-reader
Requires
- php: ^8.0
- ext-dom: *
- ext-libxml: *
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-09-18 13:51:51 UTC
README
This packages helps you to detect and read Open Graphs
tags in any html page.
Installation
You can install the package via composer:
composer require beebmx/og-reader
Usage
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();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.