?> " id="<?php echo LINKEDIN::_GET_TYPE; ?> " value="revoke" /> <input type="submit" value="Revoke Authorization" /> </form> <hr /> <h2 id="network">Your Network:</h2> <h3 id="network_stats">Stats:</h3> <?php $response = $OBJ_linkedin->statistics(); if ($response['success'] === TRUE) { $response['linkedin'] = new SimpleXMLElement($response['linkedin']); echo "<pre>" . print_r($response['linkedin'], TRUE) . "</pre>"; } else { // statistics retrieval failed echo "Error retrieving network statistics:<br /><br />RESPONSE:<br /><br /><pre>" . print_r($response) . "</pre>"; } ?> <hr /> <h3 id="network_connections">Your Connections:</h3> <?php $response = $OBJ_linkedin->connections('~/connections:(id,first-name,last-name,picture-url)?start=0&count=' . CONNECTION_COUNT);
public static function linkedin_old() { $id = ESSBSocialFansCounterHelper::get_option('linkedin.id'); $account_type = ESSBSocialFansCounterHelper::get_option('linkedin.account_type', 'company'); $app_key = ESSBSocialFansCounterHelper::get_option('linkedin.app_key'); $app_secret = ESSBSocialFansCounterHelper::get_option('linkedin.app_secret'); $oauth_token = ESSBSocialFansCounterHelper::get_option('linkedin.oauth_token'); $oauth_token_secret = ESSBSocialFansCounterHelper::get_option('linkedin.oauth_token_secret'); if (empty($id) || empty($app_secret) || empty($app_key) || $account_type == 'profile' && (empty($oauth_token) || empty($oauth_token_secret))) { return 0; } $opt = array('appKey' => $app_key, 'appSecret' => $app_secret, 'callbackUrl' => ''); $api = new LinkedIn($opt); if ($account_type == 'company') { $response = $api->company(trim('universal-name=' . $id . ':(num-followers)')); } elseif ($account_type == 'group') { $response = $api->group($id, ':(num-members)'); } else { $api->setTokenAccess(array('oauth_token' => $oauth_token, 'oauth_token_secret' => $oauth_token_secret)); $response = $api->statistics($id); } if (false == $response['success']) { return false; } $xml = new SimpleXMLElement($response['linkedin']); $count = 0; if ($account_type == 'company') { if (isset($xml->{'num-followers'})) { $count = current($xml->{'num-followers'}); } } if ($account_type == 'group') { if (isset($xml->{'num-members'})) { $count = current($xml->{'num-members'}); } } if ($account_type == 'profile') { if (isset($xml->property)) { $count = (string) $xml->property[0]; } } return $count; }