Artax based client for Twitter API

v0.1.0 2017-05-20 06:51 UTC

This package is auto-updated.

Last update: 2020-06-09 22:27:59 UTC



This project provides a crude Twitter OAuth client for AMPHP based applications. It utilizes the Artax asynchronous HTTP client while wrapping the Abraham Twitter OAuth library to properly format the request.

Utilizing the Abraham Twitter OAuth library is a preliminary step until the library can properly implement Twitters OAuth request. Until that time, signatures will be generated with blocking code. It should not be too terrible as the signature only uses a SHA1 HMAC.


Add the library via composer:

composer require aenglander/artax-twitter-oauth

To use the library, create a request factory using the credentials from your Twitter Application's Key and Access Tokens tab in the Twitter Developer applications site

$requestFactory = new AEnglander\ArtaxTwitterOAuth\RequestFactory(

Then create an Artax request for the appropriate API path:

$request = $requestFactory->createRequest('GET', 'statuses/home_timeline.json');

The previous example will get the current home time line for the user who owns the Twitter application.

Once you have the request, you can now use it with the Artax Client:

$client = new Amp\Artax\Client();
$promise = $client->request($request);
$response = \Amp\wait($promise);
    "\n%d %s\n%s\n",

The above response will execute the request and print out the result.