From 324bf733f374056bdbfe1da696713a0356344846 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 21 Dec 2023 01:58:11 +0200 Subject: [PATCH] update readme --- README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 51fafd0..a1c3eb5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,73 @@ # twister-php + PHP 8 / Composer Tools for Twister API ## Install -`composer require twisterarmy/twister` \ No newline at end of file +`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 ([Documentation](`https://www.php.net/manual/en/datetime.format.php`)) + +###### Example + +``` +$rss->setTimeFormat('c'); +``` + +##### Message + +Convert RSS fields to twister message format + +###### Mask + +* `{time}` - formatted time string by `setTimeFormat`, `U` by default +* `{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); +```