You are here

public function TwitterOAuth::__construct in Twitter 7.3

Same name and namespace in other branches
  1. 6.3 twitter.lib.php \TwitterOAuth::__construct()

Constructor for the Twitter class

Overrides Twitter::__construct

File

./twitter.lib.php, line 288
Classes to implement the full Twitter API

Class

TwitterOAuth
A class to provide OAuth enabled access to the twitter API

Code

public function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
  $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
  $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
  if (!empty($oauth_token) && !empty($oauth_token_secret)) {
    $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
  }
}