absurdityai / link-preview
AbsurdityAI Link Preview generator for PHP
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/absurdityai/link-preview
This package is auto-updated.
Last update: 2025-12-18 07:27:33 UTC
README
A small PHP library that builds the HTML meta tags required for rich link previews in social networks and messaging apps.
Installation
composer require absurdityai/link-preview
Usage
use AbsurdityAI\\LinkPreview\\LinkPreviewGenerator; $generator = new LinkPreviewGenerator(); echo $generator->generate([ 'title' => 'My Article', 'description' => 'Short summary', 'image' => 'https://example.com/image.png', 'url' => 'https://example.com/article', 'site_name' => 'Example', 'twitter_site' => '@example' ]);
The generated string can be placed inside the <head> element of your page to provide Open Graph and Twitter Card data.