PHP 8 / Composer Library for Twister
Go to file
2023-12-21 02:02:02 +02:00
src remove debug construction 2023-12-21 00:59:41 +02:00
.gitignore initial commit 2023-12-21 00:55:35 +02:00
composer.json initial commit 2023-12-21 00:55:35 +02:00
LICENSE Initial commit 2023-12-21 00:51:07 +02:00
README.md update readme 2023-12-21 02:02:02 +02:00

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

Documentation

Example
$rss->setTimeFormat('c');
Message

Convert RSS fields to twister message format, {title} {link} by default

Mask
  • {time} - formatted time string by setTimeFormat
  • {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);