Skip to content

chipslays/pastly-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—’ PHP Pastly API Client

GitHub Workflow Status GitHub release (latest by date) GitHub

Simple client implementation for Pastly API.

Pastly - The sexiest pastebin in the Internet.

Installation

composer require chipslays/pastly-api

Usage

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 folder.

Examples

Examples can be found here.

Tests

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

About

๐Ÿ—’ Simple client implementation for Pastly API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages