PHP code example of makotokw / twient
1. Go to this page and download the library: Download makotokw/twient 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/ */
makotokw / twient example snippets
use Makotokw\Twient\Twitter;
$consumer_key = 'consumer key for your application';
$consumer_secret = 'consumer secret for your application';
$oauth_token = 'oauth token for your account';
$oauth_token_secret = 'oauth token secret for your account';
$twitter = new Twitter();
$twitter->oAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$statuses = $twitter->call('statuses/home_timeline');
foreach ($statuses as $status) {
echo $status['user']['name'].': '.$status['text'].PHP_EOL;
}