corbanb/freebird-php

Twitter API v1.1 Application only authoization library

v0.2.3 2015-02-28 18:40 UTC

This package is not auto-updated.

Last update: 2024-12-21 16:00:01 UTC


README

Welcome

Freebird is a simple library designed to make connecting to Twitter's API as simple as possible on the server. Freebird was written to make life as easy as possible on developers to connect thier application servers to Twitter's API. Freebird uses the Application Only Authentication methodology, to find out more on this you can view the docs here from the offical Twitter API website.

Installing via Composer

The recomended way to install Freebird is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

# Add Freebird as a dependency
php composer.phar require corbanb/freebird-php:~0.2.4

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

Freebird Dependencies

"php": ">=5.3.0"
"guzzle/guzzle": "3.1.*"

Basic Usage

Once installed you can easily access all of the Twitter API endpoints supported by Application Only Authentication. You can view those enpoints here.

<?php

// Setup freebird Client with Twitter application keys
$client = new Freebird\Services\freebird\Client();

// init bearer token
$client->init_bearer_token('your_key', 'your_secret_key');

// optional set bearer token if already aquired
// $client->set_bearer_token('your_bearer_token');

// Request API enpoint data
$response = $client->api_request('favorites/list.json', array('screen_name' => 'corbanb'));

// return api data
echo $response;

Unit Testing

Not complete. Please feel free to fork and submit pull requests to help contribute to Freebird. Thanks.