本文整理汇总了PHP中TwitterOAuth::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP TwitterOAuth::__construct方法的具体用法?PHP TwitterOAuth::__construct怎么用?PHP TwitterOAuth::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TwitterOAuth
的用法示例。
在下文中一共展示了TwitterOAuth::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($key, $secret, $callback)
{
$this->oauth_appId = $key;
$this->oauth_appSecret = $secret;
parent::__construct($key, $secret);
$this->callback = $callback;
}
示例2: __construct
public function __construct($options)
{
$consumer_key = $options['consumer_key'];
$consumer_secret = $options['consumer_secret'];
$oauth_token = $options['oauth_token'];
$oauth_token_secret = $options['oauth_token_secret'];
parent::__construct($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$this->cacheFile = get_stylesheet_directory() . '/core/twitter/twcache.tmp';
}
示例3: __construct
public function __construct()
{
$this->consumerKey = \OpenFuego\TWITTER_CONSUMER_KEY;
$this->consumerSecret = \OpenFuego\TWITTER_CONSUMER_SECRET;
$this->accessToken = \OpenFuego\TWITTER_OAUTH_TOKEN;
$this->accessTokenSecret = \OpenFuego\TWITTER_OAUTH_SECRET;
try {
parent::__construct($this->consumerKey, $this->consumerSecret, $this->accessToken, $this->accessTokenSecret);
} catch (\PDOException $e) {
Logger::error($e);
}
}
示例4: __construct
public function __construct($oauth_token = NULL, $oauth_token_secret = NULL)
{
// Set the Consumer Key
$key = Config::get('social.twitter.app_id');
// Set the Consumer Secret
$secret = Config::get('social.twitter.app_secret');
$oauth_token = Config::get('social.twitter.access_token');
$oauth_token_secret = Config::get('social.twitter.access_token_secret');
// Log::info('app key '.$key);
// Log::info('app secret '.$secret);
// Log::info('client token '.$oauth_token);
// Log::info('client token secret '.$oauth_token_secret);
parent::__construct($key, $secret, $oauth_token, $oauth_token_secret);
}
示例5: Twconnect
/**
* 1. Twconnect class constructor, // not yet - checks login and puts user information in $this->user array
*/
public function Twconnect()
{
$ci =& get_instance();
$ci->config->load('twitter', true);
$config = $ci->config->item('twitter');
/* Try to retrieve user access token (permanent) from session */
$access_token = $ci->session->userdata('tw_access_token');
if ($access_token && isset($access_token['oauth_token']) && isset($access_token['oauth_token_secret'])) {
// echo 'Create a TwitterOauth object with consumer(app) and user tokens.';
// echo 'It is the last (third) step of Twitter OAuth process';
parent::__construct($config['consumer_key'], $config['consumer_secret'], $access_token['oauth_token'], $access_token['oauth_token_secret']);
$this->tw_access_token = $access_token;
$this->tw_user_id = isset($access_token['user_id']) ? $access_token['user_id'] : null;
$this->tw_user_name = isset($access_token['screen_name']) ? $access_token['screen_name'] : null;
/* Try to retrieve request token (temporary) from session */
} else {
$request_token = $ci->session->userdata('tw_request_token');
if ($request_token && isset($request_token['oauth_token']) && isset($request_token['oauth_token_secret'])) {
// echo 'Create object with request token key/secret sent previously to twitter';
// echo 'It is the second step of Twitter OAuth process';
parent::__construct($config['consumer_key'], $config['consumer_secret'], $request_token['oauth_token'], $request_token['oauth_token_secret']);
$this->tw_request_token = $request_token;
} else {
// echo 'Create object without access or request token';
// echo 'It is the first step of Twitter OAuth process';
parent::__construct($config['consumer_key'], $config['consumer_secret']);
}
}
$this->tw_config = $config;
$this->tw_status = $ci->session->userdata('tw_status');
$this->host = 'https://api.twitter.com/1.1/';
// Use API v1.1
}
示例6:
function __construct($apipath, $consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL)
{
parent::__construct($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$this->host = $apipath;
}
示例7: __construct
public function __construct($oauth_token = null, $oauth_token_secret = null)
{
$this->_key = config('services.twitter.key');
$this->_secret = config('services.twitter.secret');
parent::__construct($this->_key, $this->_secret, $oauth_token, $oauth_token_secret);
}
示例8: rdconnection
public function rdconnection($o_token = "", $o_token_secret = "")
{
$appkey = $this->_ci->config->item('twitter_key');
$appsecret = $this->_ci->config->item('twitter_secret');
return parent::__construct($appkey, $appsecret, $o_token, $o_token_secret);
}