本文整理汇总了PHP中LinkedIn::search方法的典型用法代码示例。如果您正苦于以下问题:PHP LinkedIn::search方法的具体用法?PHP LinkedIn::search怎么用?PHP LinkedIn::search使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkedIn
的用法示例。
在下文中一共展示了LinkedIn::search方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']);
$_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']);
}
# 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 '<pre>';
echo 'My Profile Info';
echo $xml_response;
echo '<br />';
echo '</pre>';
$search_response = $linkedin->search("?company-name=facebook&count=10");
//$search_response = $linkedin->search("?title=software&count=10");
//echo $search_response;
$xml = simplexml_load_string($search_response);
echo '<pre>';
echo 'Look people who worked in facebook';
print_r($xml);
echo '</pre>';
示例2: Area
} else {
// update retrieval failed
echo "Error retrieving updates:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response) . "</pre>";
}
?>
<hr />
<h2 id="search">People Search:</h2>
<p>All 1st degree connections living in the San Francisco Bay Area (returned in JSON format):</p>
<?php
$OBJ_linkedin->setResponseFormat(LINKEDIN::_RESPONSE_JSON);
$query = '?facet=location,us:84&facet=network,F';
$response = $OBJ_linkedin->search($query);
if ($response['success'] === TRUE) {
//$response['linkedin'] = new SimpleXMLElement($response['linkedin']);
echo "<pre>" . print_r($response['linkedin'], TRUE) . "</pre>";
} else {
// people search retrieval failed
echo "Error retrieving search results:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response) . "</pre>";
}
?>
<hr />
<h2 id="content">Creating / Sharing Content</h2>
<h3 id="content_update">Post Network Update:</h3>
<form id="linkedin_nu_form" action="<?php
示例3: LinkedIn
<?php
require_once 'linkedin.php';
# Use this to used already retrieved access token credentials for testing.
$consumer_key = "";
$consumer_secret = "";
$access_token = "";
$access_token_secret = "";
# 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;
$linkedin->access_token = new OAuthConsumer($access_token, $access_token_secret, 1);
# Let's do a search!
$search_response = $linkedin->search("?company=Google&count=10");
echo $search_response;