PHP 8 / Composer Library for Twister
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.

79 lines
1.1 KiB

5 months ago
# twister-php
5 months ago
5 months ago
PHP 8 / Composer Library for Twister P2P
5 months ago
## Install
5 months ago
`composer require twisterarmy/twister`
## Features
### Client
Twister client communication toolkit
5 months ago
```
$client = new \Twisterarmy\Twister\Client('http', 'localhost', 28332, 'user', 'pwd');
var_dump(
$client->getPosts(
[
'twisterarmy'
]
)
);
```
#### Methods
Currently not documented, please visit src/Client.php for details
* importWallet
* getBlockHash
* getBlock
* getPosts
* getPostK
* follow
* unFollow
* getFollowing
* getDHTProfileRevisions
* getDHTAvatarRevisions
* putDHT
* createWalletUser
* sendNewUserTransaction
* newPostMessage
* newRetwistMessage
### Tools
5 months ago
#### RSS
5 months ago
Useful to create twister news bot
5 months ago
##### Feed
5 months ago
5 months ago
Read remote URL and convert response to formatted twister messages
5 months ago
```
$array = \Twisterarmy\Twister\Tools\Rss::feed('url');
5 months ago
```
5 months ago
###### Request
5 months ago
5 months ago
* `url` - feed address
* `format` - `{title} {link}` by default
+ `{nl}` - new line
+ `{title}` - item title
5 months ago
+ `{link}` - target link
5 months ago
* `length` - `256` by default
* `errors` - array of errors
5 months ago
5 months ago
###### Response
5 months ago
```
5 months ago
[
time: int,
message: string
],
...
```