decodelabs / chirp
Tweet parser
v0.9.1
2024-08-22 01:26 UTC
Requires
- php: ^8.1
- decodelabs/tagged: ^0.15
Requires (Dev)
README
Twitter tools for PHP
Chirp currently provides a hand-rolled tweet parser allowing you to render imported tweets on your site without hassle.
Get news and updates on the DecodeLabs blog.
Installation
Install the library via composer:
composer require decodelabs/chirp
Usage
Parse a tweet into HTML:
use DecodeLabs\Chirp\Parser;
$parser = new Parser();
echo $parser->parse($myTweet);
Metamorph
Chirp also provides a Metamorph Handler so that it can be used via its simplified interface:
use DecodeLabs\Metamorph;
echo Metamorph::tweet($myTweet);
Output
The parsed HTML provided by Chirp is now wrapped in a Markup
interface from the Tagged library such that output is handled correctly in all rendering contexts.
Licensing
Chirp is licensed under the MIT License. See LICENSE for the full license text.