PHP code example of webiny / twitter-oauth

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

    

webiny / twitter-oauth example snippets


$tw = TwitterOAuthLoader::getInstance('MyTwitterApp');

$tw->setAccessToken(...);

// get user details for current access token
$user = $tw->getUserDetails(); // returns TwitterOAuthUser object

// perform any other API operation
$tw->get($url, $params);
$tw->post($url, $params);
$tw->delete($url, $params);