-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_en.php
More file actions
90 lines (71 loc) · 1.97 KB
/
example_en.php
File metadata and controls
90 lines (71 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
// Include the Class Definition
require_once('oauth_en.php');
/*
*
* @abstract: Test LinkedIn's Php Class
* @author: Christophe Fiat
* @copyright: FormatiX.EU
*
*/
// Set Parameters
$params = Array( 'consumerKey' => 'YOUR_CONSUMER_KEY',
'consumerSecret' => 'YOUR_CONSUMER_SECRET_KEY',
'localUrl' => 'YOUR_Local_URL',
'callbackUrl' => 'YOUR_Callback_URL',
'zendPath' => 'YOUR_Zend_Path',
'zendIncubatorPath' => 'YOUR_Zend_Incubator_Path'
);
// Create an Instance of LinkedIn's PHP Class
$linkedin = new linkedIn($params);
// Connect to LinkedIn API Via OAuth
$linkedin->connect();
// Call whoAmI method to Get User's profile
$profilInfo =$linkedin->whoAmI();
// Display User's profile
echo'<h2>First Name: '.$profilInfo['firstName']. '</h2>';
echo'<h2>Last Name: '.$profilInfo['lastName']. '</h2>';
echo'<h2>HeadLine: '.$profilInfo['headline']. '</h2>';
echo'<h2><a href="'.$profilInfo['profilUrl'].'"> LinkedIn Profile </a></h2>';
// Get User's Status
$userStatus = $linkedin->getStatus();
// Display User's Status
if(!empty($userStatus))
{
echo"<h2>Statut Of ".$profilInfo['firstName'] . ' ' . $profilInfo['lastName'] .":
$userStatus </h2>";
}
else
{
echo'<h2>No Status</h2>';
}
// Modify User's LinkedIn Status
$linkedin->updateStatus('is Building a PHP Class to Update Status');
// Get The New Status
$userStatus = $linkedin->getStatus();
// Display User's LinkedIn Status
if(!empty($userStatus))
{
echo"<h2>Statut Of ".$profilInfo['firstName'] . ' ' . $profilInfo['lastName'] .":
$userStatus </h2>";
}
else
{
echo'<h2>No Status</h2>';
}
// Clear User's LinkedIn Status
$linkedin->clearStatus();
// Get Status
$userStatus = $linkedin->getStatus();
// Display User's Status
if(!empty($userStatus))
{
echo"<h2>Statut Of ".$profilInfo['firstName'] . ' ' . $profilInfo['lastName'] .":
$userStatus </h2>";
}
else
{
echo'<h2>No Status</h2>';
}
// The END! ;)
?>