Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chipslays/pastly-api
🗒 Simple client implementation for Pastly API.
https://github.com/chipslays/pastly-api
api api-client client hastebin pastebin pastebin-api pastebin-service pastly
Last synced: 7 days ago
JSON representation
🗒 Simple client implementation for Pastly API.
- Host: GitHub
- URL: https://github.com/chipslays/pastly-api
- Owner: chipslays
- License: mit
- Created: 2021-05-28T22:39:26.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T05:56:04.000Z (over 3 years ago)
- Last Synced: 2024-08-15T06:04:13.832Z (3 months ago)
- Topics: api, api-client, client, hastebin, pastebin, pastebin-api, pastebin-service, pastly
- Language: PHP
- Homepage: https://pastly.cf
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🗒 PHP Pastly API Client
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/chipslays/pastly-api/tests)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/chipslays/pastly-api)
![GitHub](https://img.shields.io/github/license/chipslays/pastly-api)Simple client implementation for [Pastly](https://pastly.chipslays.ru) API.
> **Pastly** - The sexiest pastebin in the Internet.
## Installation
```bash
composer require chipslays/pastly-api
```## Usage
```php
use Pastly\Client;require 'vendor/autoload.php';
$client = new Client;
$token = '1622233044:6bCVU-8OI9fjtk3gXhZRJkzQeDGsJNKti2MuBM_n9V';/** get paste */
$paste = $client->get('example-slug');
$paste = pastly_get('example-slug');echo $paste->getText();
/** create paste */
$client->create($token, 'Hello, world!');
pastly_create($token, 'Hello, world!');/** edit paste */
$client->edit($token, 'example-slug', [
'title' => 'New Title',
'syntax' => 'diff',
'text' => "this text\n-was edited\n+successful",
]);pastly_edit($token, 'example-slug', [
'title' => 'New Title',
'syntax' => 'diff',
'text' => "this text\n-was edited\n+successful",
]);
```More code can see in [examples](/examples/) folder.
## Examples
Examples can be found [here](/examples/).
## Tests
```bash
composer test
```## Credits
- [Chipslays](https://github.com/chipslays)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.