2017 © Pedro Peláez
 

library twitter-oauth

Twitter OAuth API for PHP 5.3+

image

widop/twitter-oauth

Twitter OAuth API for PHP 5.3+

  • Friday, February 7, 2014
  • by Widop
  • Repository
  • 5 Watchers
  • 7 Stars
  • 1,635 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

README

Build Status, (*1)

The Wid'op OAuth library is a modern PHP 5.3+ API allowing you to easily obtain a Twitter access token. For now, it supports OAuth Web & Application tokens (not xOAuth)., (*2)

Here a sample for the Web workflow:, (*3)

``` php use Widop\HttpAdapter\CurlHttpAdapter; use Widop\Twitter\OAuth;, (*4)

// First, instantiate your OAuth client. $oauth = new OAuth\OAuth( new CurlHttpAdapter(), new OAuth\OAuthConsumer('consumer_key', 'consumer_secret'), new OAuth\Signature\OAuthHmacSha1Signature() );, (*5)

// Second, get/cache a "request token" somewhere (here in session) if (!isset($_SESSION['my_request_session'])) { $requestToken = $oauth->getRequestToken('http://my-app.com/twitter-callback.php'); $_SESSION['my_request_session'] = serialize($requestToken); } else { $requestToken = unserialize($_SESSION['my_request_token']); }, (*6)

// Third, redirect the user on twitter for getting permissions echo 'Authorize the application';, (*7)

// Then, get an "access token" if (isset($_REQUEST['oauth_verifier'])) { $accessToken = $oauth->getAccessToken($requestToken, $_REQUEST['oauth_verifier']);, (*8)

// Save the access token somewhere for further purpose!

} ```, (*9)

Documentation

  1. Installation
  2. OAuth

Testing

The library is fully unit tested by PHPUnit with a code coverage close to 100%. To execute the test suite, check the travis configuration., (*10)

Contribute

We love contributors! The library is open source, if you'd like to contribute, feel free to propose a PR!, (*11)

License

The Wid'op OAuth library is under the MIT license. For the full copyright and license information, please read the LICENSE file that was distributed with this source code., (*12)

The Versions

07/02 2014

dev-master

9999999-dev

Twitter OAuth API for PHP 5.3+

  Sources   Download

MIT

The Requires

 

The Development Requires

by Geoffrey BRIER
by Eric GELOEN
by Avatar Widop

api oauth twitter