1. Go to this page and download the library: Download laminas/laminas-twitter 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/ */
public function get(string $path, array $query = []) : Response;
public function post(string $path, $data = null) : Response;
$image = new Image('data/logo.png', 'image/png');
$response = $image->upload($twitter->getHttpClient());
$twitter->statusUpdate(
'A post with an image',
null,
['media_ids' => [$response->media_id]]
);
$response = $twitter->statusUpdate('A post');
$rateLimit = $response->getRateLimit();
if ($rateLimit->remaining === 0) {
// Time to back off!
sleep($rateLimit->reset); // seconds left until reset
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.