1. Go to this page and download the library: Download maalls/twitterapi 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/ */
maalls / twitterapi example snippets
use Maalls\TwitterApi;
// A get request.
$api = new TwitterApi($access_token, $access_token_secret, $consumer_key, $consumer_secret);
$json = $api->get('search/tweets', array('q' => "github"));
// A post request.
$json = $api->>post("statuses/update", array("status" => "I love coding."));
// iterate() works for actions that returns an array of tweets: it collects all the tweets available by making several HTTP request and adjusting max_id parameters.
// see https://dev.twitter.com/rest/public/timelines
$json = $api->iterate('twitter/search', array('q' => 'githun'));