twistertwister-phptwister-p2ptwister-api-phptwister-php-8twister-curltwister-apitwister-composertwister-rssphp-8twister-clienttwister-php-clienttwister-library
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.0 KiB
1.0 KiB
twister-php
PHP 8 / Composer Tools for Twister API
Install
composer require twisterarmy/twister
Features
Client
Twister client communication toolkit
RSS
RSS toolkit for twister
Init
$rss = new \Twisterarmy\Twister\Rss();
Format
Time
Convert RSS time to datetime format, U
by default
Example
$rss->setTimeFormat('c');
Message
Convert RSS fields to twister message format, {title} {link}
by default
Mask
{time}
- formatted time string bysetTimeFormat
{link}
- target link{title}
- item title
Example
$rss->setMessageFormat('{title} {link}');
Length
Twister protocol accept messages with 256 chars max but you can define another value.
Formatted messages greater this value will be skipped from feed.
Example
$rss->setLength(256);
Feed
Get formatted feed array
Example
$feed = $rss->get(url);