Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Agents
dg/twitter-php
claude-code
cursor
api
oauth
twitter
x

It is my fervent wish that this file guide every AI coding agent working with code in this repository.

Install
php artisan boost:add-skill dg/twitter-php

Save this content to: AGENTS.md

# To My Agents!

It is my fervent wish that this file guide every AI coding agent working with code in this repository.

## Overview

X for PHP (`dg/twitter-php`) — a PHP library for the X (formerly Twitter) API v2 using OAuth 1.0a authentication. Requires PHP 8.2+ and Guzzle HTTP client.

## Architecture

Two source files in `src/`:

- **`Client.php`** — Main API client (`DG\X\Client`). All X operations: `sendTweet()`, `deleteTweet()`, `getTweet()`, `getMyTweets()`, `getTimeline()`, `getMentions()`, `search()`, `getUser()`, `getUserById()`, `getFollowers()`, `follow()`, `sendDirectMessage()`, plus generic `request()` for any v2 endpoint. Uses Guzzle for HTTP, inline OAuth 1.0a signing, optional file-based caching. Backward compatibility aliases for `DG\Twitter\Twitter` and `Twitter` at file bottom.
- **`Exception.php`** — `DG\X\Exception` with aliases for `DG\Twitter\Exception` and `TwitterException`.

Autoloading uses classmap. Media upload still uses Twitter API v1.1 endpoint (`upload.twitter.com`).

## Commands

```bash
composer tester        # run tests (Nette Tester)
composer phpstan       # run PHPStan level 8
```

## Testing

Tests in `tests/Client/` using Nette Tester (`.phpt` files). Unit tests run always; integration tests require env vars `X_CONSUMER_KEY`, `X_CONSUMER_SECRET`, `X_ACCESS_TOKEN`, `X_ACCESS_TOKEN_SECRET` and are skipped otherwise.

To My Agents!

It is my fervent wish that this file guide every AI coding agent working with code in this repository.

Overview

X for PHP (dg/twitter-php) — a PHP library for the X (formerly Twitter) API v2 using OAuth 1.0a authentication. Requires PHP 8.2+ and Guzzle HTTP client.

Architecture

Two source files in src/:

  • Client.php — Main API client (DG\X\Client). All X operations: sendTweet(), deleteTweet(), getTweet(), getMyTweets(), getTimeline(), getMentions(), search(), getUser(), getUserById(), getFollowers(), follow(), sendDirectMessage(), plus generic request() for any v2 endpoint. Uses Guzzle for HTTP, inline OAuth 1.0a signing, optional file-based caching. Backward compatibility aliases for DG\Twitter\Twitter and Twitter at file bottom.
  • Exception.php — DG\X\Exception with aliases for DG\Twitter\Exception and TwitterException.

Autoloading uses classmap. Media upload still uses Twitter API v1.1 endpoint (upload.twitter.com).

Commands

composer tester        # run tests (Nette Tester)
composer phpstan       # run PHPStan level 8

Testing

Tests in tests/Client/ using Nette Tester (.phpt files). Unit tests run always; integration tests require env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET and are skipped otherwise.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource