本文整理汇总了PHP中OAuth::createOAuth方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuth::createOAuth方法的具体用法?PHP OAuth::createOAuth怎么用?PHP OAuth::createOAuth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuth
的用法示例。
在下文中一共展示了OAuth::createOAuth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFeed
public function getFeed()
{
$oauthParams = (object) array();
$oauthParams->apiKey = $this->API_KEY;
$oauthParams->apiSecret = $this->API_SECRET;
$oauthParams->tokenKey = $this->OAUTH_USER_TOKEN;
$oauthParams->tokenSecret = $this->OAUTH_USER_SECRET;
$params = array();
$params["screen_name"] = "taivasfi";
//$params["count"] = "8";
$params = (object) $params;
$url = OAuth::createOAuth("https://api.twitter.com/1.1/statuses/user_timeline.json", $oauthParams, $params, false);
$data = $this->getURL($url);
return $data;
}
示例2: getFeed
public function getFeed()
{
$oauthParams = (object) array();
$oauthParams->apiKey = $this->API_KEY;
$oauthParams->apiSecret = $this->API_SECRET;
$oauthParams->tokenKey = $this->OAUTH_USER_TOKEN;
$oauthParams->tokenSecret = $this->OAUTH_USER_SECRET;
$params = array();
$params["event-type"] = "status-update";
$params["format"] = "json";
$params = (object) $params;
$url = OAuth::createOAuth("http://api.linkedin.com/v1/companies/16019/updates", $oauthParams, $params);
//die($url);
$data = $this->getURL($url);
return $data;
}
示例3: elseif
&event-type%3Dstatus-update%26format%3Djson%26
oauth_consumer_key%3D77rggpkbr2jf9r%26
oauth_nonce%3D3334341234%26
oauth_signature_method%3DHMAC-SHA1%26
oauth_timestamp%3D1386345627%26
oauth_token%3D4005c9be-7414-4ec6-b89f-87bdf0bb715f%26
oauth_version%3D1.0
if(!isset($ret->tokenKey)) $ret->tokenKey = FlickrHA::$tokenKey;
if(!isset($ret->tokenSecret)) $ret->tokenSecret = FlickrHA::$tokenSecret;
if(!isset($ret->format)) $ret->format = FlickrParamsHA::PHPFORMAT;
*/
$url = OAuth::createOAuth("http://api.linkedin.com/v1/companies/16019/updates", $oauthParams, $params);
echo "<br>GET&http%3A%2F%2Fapi.linkedin.com%2Fv1%2Fcompanies%2F16019%2Fupdates&event-type%3Dstatus-update%26format%3Djson%26oauth_consumer_key%3D77rggpkbr2jf9r%26oauth_nonce%3D3334341234%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1386345627%26oauth_token%3D4005c9be-7414-4ec6-b89f-87bdf0bb715f%26oauth_version%3D1.0";
echo "<br><br>vpSOM0kdQuH5JZettoRSCTCCskI=<br><br>";
die($url);
// OAuth 2 Control Flow
/*if (isset($_GET['error'])) {
// LinkedIn returned an error
print $_GET['error'] . ': ' . $_GET['error_description'];
exit;
} elseif (isset($_GET['code'])) {
// User authorized your application
if ($_SESSION['state'] == $_GET['state']) {
// Get token so you can make API calls
getAccessToken();
} else {
// CSRF attack? Or did you mix up your states?