當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LinkedIn::setStatus方法代碼示例

本文整理匯總了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;
 }
開發者ID:neevan1e,項目名稱:Done,代碼行數:15,代碼來源:class.linkedClass.php

示例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;
開發者ID:raj4126,項目名稱:twextra,代碼行數:31,代碼來源:page2.php

示例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;
開發者ID:edmarmoretti,項目名稱:i3geo,代碼行數:28,代碼來源:testLinkedinOauth.php


注:本文中的LinkedIn::setStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。