PHP code example of jublonet / oauth-validator-php

1. Go to this page and download the library: Download jublonet/oauth-validator-php 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/ */

    

jublonet / oauth-validator-php example snippets




\Jublo\Oauth_Validator::setConsumerKey('******', '******');
$ov = \Jublo\Oauth_Validator::getInstance();
$ov->setToken("******", "******");

$params = array(
    'status' => 'Hashtags are cool, when they work. http://www.example.com/gear#id=3&type=store'
);

$authorization = 'OAuth oauth_consumer_key="******", oauth_nonce="6f8b2bc8", oauth_signature="DRicJWVJQFOxdnRgh7hsyvqd8sQ%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1416406562", oauth_token="******", oauth_version="1.0"';

$reply = $ov->validate($authorization, 'POST', 'https://api.twitter.com/1.1/statuses/update.json', $params);
var_dump($reply);