当前位置: 首页>>代码示例>>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;未经允许,请勿转载。