Twitter::__construct PHP Method

__construct() public method

Creates object using consumer and access keys.
public __construct ( $consumerKey, $consumerSecret, $accessToken = NULL, $accessTokenSecret = NULL )
    public function __construct($consumerKey, $consumerSecret, $accessToken = NULL, $accessTokenSecret = NULL)
    {
        if (!extension_loaded('curl')) {
            throw new TwitterException('PHP extension CURL is not loaded.');
        }
        $this->consumer = new Twitter_OAuthConsumer($consumerKey, $consumerSecret);
        $this->token = new Twitter_OAuthConsumer($accessToken, $accessTokenSecret);
    }

Usage Example

Ejemplo n.º 1
0
 public function __construct($config)
 {
     parent::setVariables($config);
     $this->callback_getdata = array(array($this, 'oauthRequest'), array('search', array('q' => $config['terms'], 'rpp' => $config['total'], 'result_type' => 'recent'), "http://search.twitter.com/"));
     $this->setURL('http://search.twitter.com/' . $config['terms'] . '/' . $config['total']);
     $this->setItemTemplate('<li class="clearfix"><span class="image"><a href="{{{user_link}}}"><img width="48" src="{{{user_image}}}" alt="{{{user_nickname}}}" /></a></span>{{{text}}}<p class="date"><a href="{{{link}}}">{{{date}}}</a></p></li>' . "\n");
     $this->setURLTemplate('http://search.twitter.com/search?q=' . $config['terms']);
     parent::__construct($config);
 }
All Usage Examples Of Twitter::__construct