1. Go to this page and download the library: Download anton-am/telegraph library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$telegraph = new \AntonAm\Telegraph\Manager('ACCESS_TOKEN_FROM_CREATE');
//Get user information
$account = $telegraph->account()->get();
//Edit user information
$account = $telegraph->account()->edit('NewShortName', 'NewPublicName', 'https://new.url');
//Revoke/reload user access token
$account = $telegraph->account()->revoke();
//List of user pages
$account = $telegraph->account()->pages();
//Create new account and page
$telegraph = new \AntonAm\Telegraph\Manager();
$page = $telegraph->page()->setTitle('Sed')
->addText('Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu.')
->create();
$telegraph = new \AntonAm\Telegraph\Manager('b7316e15f67fe9a397ea8b151d5e15a75a9702e2472775fc3ab0e418467d');
$page = $telegraph->page('Test-08-26-233')
->setAuthor('User Name', 'https://www.google.com/')
->setTitle('Nunc egestas augue')
->addText('Nunc sed turpis. Praesent blandit laoreet nibh.
Nam at tortor in tellus interdum sagittis. Quisque id odio.
Aliquam lobortis. Pellentesque libero tortor, tincidunt et, tincidunt eget, semper nec, quam.')
->addLink('Telegraph', 'https://telegra.ph')
->addImage('http://telegra.ph/file/6a5b15e7eb4d7329ca7af.jpg')
->addHtml('hr')
->addHtml('h3', 'Header')
->edit();
$telegraph = new \AntonAm\Telegraph\Manager('b7316e15f67fe9a397ea8b151d5e15a75a9702e2472775fc3ab0e418467d');
//Page views statistic
$page = $telegraph->page('Test-08-26-233')->statistic();
//Page data
$page = $telegraph->page('Test-08-26-233')->get();
try {
$telegraph = new \AntonAm\Telegraph\Manager();
$newAccount = $telegraph->page()->setTitle('New page')->create('/new');
} catch (\AntonAm\Telegraph\Exceptions\NodeException $e) {
//Custom tag problem
} catch (\AntonAm\Telegraph\Exceptions\PageException $e) {
//Page command problem
} catch (\AntonAm\Telegraph\Exceptions\TelegraphRequestException $e){
//Telegraph exception problem
} catch (\Exception $e) {
//Common problem catcher: guzzle, json decode or something else
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.