本文整理汇总了PHP中LinkedIn::setStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP LinkedIn::setStatus方法的具体用法?PHP LinkedIn::setStatus怎么用?PHP LinkedIn::setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkedIn
的用法示例。
在下文中一共展示了LinkedIn::setStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: linkedInStatus
public function linkedInStatus($status, $requestToken = '', $oauthVerifier = '', $accessToken = '')
{
include_once 'linkedinoAuth.php';
$linkedin = new LinkedIn($this->config['linkedin_access'], $this->config['linkedin_secret']);
$linkedin->request_token = unserialize($requestToken);
//as data is passed here serialized form
$linkedin->oauth_verifier = $oauthVerifier;
$linkedin->access_token = unserialize($accessToken);
try {
$xml_response = $linkedin->setStatus($status);
} catch (Exception $o) {
print_r($o);
}
return $xml_response;
}
示例2: linkedinStatusUpdate
public function linkedinStatusUpdate($status = '', $requestToken = '', $oauthVerifier = '', $accessToken = '')
{
include_once $this->config['linkedin_library_path'];
$linkedin = new LinkedIn($this->config['linkedin_access'], $this->config['linkedin_secret']);
$linkedin->request_token = unserialize($requestToken);
$linkedin->oauth_verifier = $oauthVerifier;
$linkedin->access_token = unserialize($accessToken);
try {
$stat = $linkedin->setStatus($status);
echo "Linkedin status updated successfully!<br />";
} catch (Exception $o) {
echo "<br />Linkedin Status couldn't updated!</br>";
print_r($o);
echo '<br />';
}
}
开发者ID:BGCX067,项目名称:facebook-twitter-linkedin-status-update-svn-to-git,代码行数:16,代码来源:class.fblinkedtwit.php
示例3: LinkedIn
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['callback_url']);
//$linkedin->debug = true;
if (isset($_REQUEST['oauth_verifier'])) {
$_SESSION['oauth_verifier'] = $_REQUEST['oauth_verifier'];
$linkedin->request_token = unserialize($_SESSION['requestToken']);
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->getAccessToken($_REQUEST['oauth_verifier']);
logger("Ln/Page2: access token1: ", $linkedin->access_token);
$_SESSION['oauth_access_token'] = serialize($linkedin->access_token);
header("Location: " . $config['callback_url']);
exit;
} else {
$linkedin->request_token = unserialize($_SESSION['requestToken']);
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->access_token = unserialize($_SESSION['oauth_access_token']);
logger("Ln/Page2: access token2: ", $linkedin->access_token);
}
# You now have a $linkedin->access_token and can make calls on behalf of the current member
//$status = "This is a test".date("Y:m:d H-i-s");
$ln_access_token = $linkedin->access_token;
logger("Ln/Page2: access token3: ", $ln_access_token);
$status = $_SESSION['message'];
$prefix = $_SESSION['prefix'];
$message_id = $_SESSION['message_id'];
$status = "{$hostname}/{$message_id}";
$response = $linkedin->setStatus($prefix . $status);
$_SESSION['update_li'] = 1;
logger("Ln/Page2 status: ", $status);
header("Location: {$status}");
exit;
示例4: dirname
<?php
require_once 'linkedin.php';
include dirname(__FILE__) . "/../../ms_configura.php";
$consumer_key = $linkedinoauth["consumerkey"];
$consumer_secret = $linkedinoauth["consumersecret"];
echo "<pre>";
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($consumer_key, $consumer_secret, "oob");
$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
# With a request token in hand, we can generate an authorization URL, which we'll direct the user to
echo "Authorization URL: " . $linkedin->generateAuthorizeUrl() . "\n\n";
# After logging in, the user will be presented with an OAuth Verifier, which you would then ask the member to enter in a UI you present. Once you have the OAuth verifier, set it here:
echo "Enter OAuth Verifier:\n";
$handle = fopen("php://stdin", "r");
$oauth_verifier = trim(fgets($handle));
$linkedin->getAccessToken($oauth_verifier);
# You now have a $linkedin->access_token and can make calls on behalf of the current member
$xml_response = $linkedin->getProfile("~:(id,first-name,last-name,headline,picture-url)");
echo $xml_response;
# Let's set our status
$xml_response2 = $linkedin->setStatus("setting my status using the LinkedIn API.");
echo $xml_response2;
# Let's do a search!
$search_response = $linkedin->search("?company=Google&count=10");
echo $search_response;