PHP code example of darvis / api-x
1. Go to this page and download the library: Download darvis/api-x 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/ */
darvis / api-x example snippets
use Darvis\ApiX\XClient;
$result = app(XClient::class)->post('Working on something new', storage_path('app/screenshot.png'));
$result->url(); // https://x.com/i/web/status/...
$mention = app(XClient::class)->mentions(limit: 5)[0];
app(XClient::class)->post('Thanks, glad it helps!', replyTo: $mention->id);
bash
php artisan x:install