PHP code example of wp-pure / twitter-aggregator

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

    

wp-pure / twitter-aggregator example snippets




// generate an aggregator object
$ta = new twitterAggregator( array(

	// twitter API consumer key, secret, and oath token and oauth secret
    'consumer_key' => "[CONSUMER KEY]",
    'consumer_secret' => "[CONSUMER SECRET]",
    'oauth_access_token' => "[OAUTH ACCESS TOKEN]",
    'oauth_access_token_secret' => "[OAUTH ACCESS TOKEN SECRET]",

    // comma separated list of twitter handles to pull
    'usernames' => "[TWITTER USERNAMES]",

    // set the number of tweets to show
    'count' => 10,

	// set an update interval (minutes)
    'update_interval' => 10,

    // set the cache directory name/path
    'cache_dir' => 'cache',

    // boolean, exclude replies, default true
    'exclude_replies' => true,

    // boolean, 

// display the widget
$ta->display();

// display the widget without any styles
$ta->display_unstyled();

// fetch the widget code
$code = $ta->widget();

// fetch data
$data = $ta->fetch();