Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JLinkedinStream
+ Graphe d'héritage de JLinkedinStream:
+ Graphe de collaboration de JLinkedinStream:

Liste de tous les membres

Fonctions membres publiques

 share ($visibility, $comment=null, $title=null, $url=null, $image=null, $description=null, $twitter=false)
 reshare ($visibility, $id, $comment=null, $twitter=false)
 getCurrentShare ($id=null, $url=null)
 getShareStream ($id=null, $url=null, $self=true)
 getNetworkUpdates ($id=null, $self=true, $type=null, $count=0, $start=0, $after=null, $before=null, $hidden=false)
 getNetworkStats ()
 postNetworkUpdate ($body)
 getComments ($key)
 postComment ($key, $comment)
 getLikes ($key)
 like ($key)
 unlike ($key)
- Fonctions membres publiques inherited from JLinkedinObject
 __construct (JRegistry $options=null, JHttp $client=null, JLinkedinOAuth $oauth=null)
 booleanToString ($bool)
 getOption ($key)
 setOption ($key, $value)

Fonctions membres privées

 _likeUnlike ($key, $like)

Additional Inherited Members

- Attributs protégés inherited from JLinkedinObject
 $options
 $client
 $oauth

Description détaillée

Définition à la ligne 19 du fichier stream.php.


Documentation des fonctions membres

JLinkedinStream::_likeUnlike (   $key,
  $like 
)
private

Method to like or unlike an update.

Paramètres:
string$keyUpdate/update-key representing an update.
boolean$likeTrue to like update, false otherwise.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 571 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 204);
// Set the API base
$base = '/v1/people/~/network/updates/key=' . $key . '/is-liked';
// Build xml.
$xml = '<is-liked>' . $this->booleanToString($like) . '</is-liked>';
// Build the request path.
$path = $this->getOption('api.url') . $base;
$header['Content-Type'] = 'text/xml';
// Send the request.
$response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header);
return $response;
}
JLinkedinStream::getComments (   $key)

Method to retrieve all comments for a given network update.

Paramètres:
string$keyupdate/update-key representing an update.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 463 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/~/network/updates/key=' . $key . '/update-comments';
// Set request parameters.
$data['format'] = 'json';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinStream::getCurrentShare (   $id = null,
  $url = null 
)

Method to get a particular member's current share.

Paramètres:
string$idMember id of the profile you want.
string$urlThe public profile URL.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 183 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/';
// Check if a member id is specified.
if ($id)
{
$base .= 'id=' . $id;
}
elseif (!$url)
{
$base .= '~';
}
// Check if profile url is specified.
if ($url)
{
$base .= 'url=' . $this->oauth->safeEncode($url);
}
$base .= ':(current-share)';
// Set request parameters.
$data['format'] = 'json';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinStream::getLikes (   $key)

Method to retrieve the complete list of people who liked an update.

Paramètres:
string$keyupdate/update-key representing an update.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 537 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/~/network/updates/key=' . $key . '/likes';
// Set request parameters.
$data['format'] = 'json';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinStream::getNetworkStats ( )

Method to get information about the current member's network.

Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 388 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/~/network/network-stats';
// Set request parameters.
$data['format'] = 'json';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinStream::getNetworkUpdates (   $id = null,
  $self = true,
  $type = null,
  $count = 0,
  $start = 0,
  $after = null,
  $before = null,
  $hidden = false 
)

Method to get the users network updates.

Paramètres:
string$idMember id.
boolean$selfUsed to return member's feed. Omitted to return aggregated network feed.
mixed$typeString containing any valid Network Update Type from the table or an array of strings to specify more than one Network Update type.
integer$countNumber of updates to return, with a maximum of 250.
integer$startThe offset by which to start Network Update pagination.
string$afterTimestamp after which to retrieve updates.
string$beforeTimestamp before which to retrieve updates.
boolean$hiddenWhether to display updates from people the member has chosen to "hide" from their update stream.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 302 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/';
// Check if a member id is specified.
if ($id)
{
$base .= $id;
}
else
{
$base .= '~';
}
$base .= '/network/updates';
// Set request parameters.
$data['format'] = 'json';
// Check if self is true.
if ($self)
{
$data['scope'] = 'self';
}
// Check if type is specified.
if ($type)
{
$data['type'] = $type;
}
// Check if count is specified.
if ($count > 0)
{
$data['count'] = $count;
}
// Check if start is specified.
if ($start > 0)
{
$data['start'] = $start;
}
// Check if after is specified.
if ($after)
{
$data['after'] = $after;
}
// Check if before is specified.
if ($before > 0)
{
$data['before'] = $before;
}
// Check if hidden is true.
if ($hidden)
{
$data['hidden'] = $hidden;
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinStream::getShareStream (   $id = null,
  $url = null,
  $self = true 
)

Method to get a particular member's current share.

Paramètres:
string$idMember id of the profile you want.
string$urlThe public profile URL.
boolean$selfUsed to return member's feed. Omitted to return aggregated network feed.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 236 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the API base
$base = '/v1/people/';
// Check if a member id is specified.
if ($id)
{
$base .= $id;
}
elseif (!$url)
{
$base .= '~';
}
// Check if profile url is specified.
if ($url)
{
$base .= 'url=' . $this->oauth->safeEncode($url);
}
$base .= '/network';
// Set request parameters.
$data['format'] = 'json';
$data['type'] = 'SHAR';
// Check if self is true
if ($self)
{
$data['scope'] = 'self';
}
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
return json_decode($response->body);
}
JLinkedinStream::like (   $key)

Method used to like an update.

Paramètres:
string$keyUpdate/update-key representing an update.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 609 du fichier stream.php.

{
return $this->_likeUnlike($key, true);
}
JLinkedinStream::postComment (   $key,
  $comment 
)

Method to post a new comment to an existing update.

Paramètres:
string$keyupdate/update-key representing an update.
string$commentMaximum length of 700 characters
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 497 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base
$base = '/v1/people/~/network/updates/key=' . $key . '/update-comments';
// Build the xml.
$xml = '<update-comment>
<comment>' . $comment . '</comment>
</update-comment>';
$header['Content-Type'] = 'text/xml';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinStream::postNetworkUpdate (   $body)

Method to get the users network updates.

Paramètres:
string$bodyThe actual content of the update. You can use HTML to include links to the user name and the content the user created. Other HTML tags are not supported. All body text should be HTML entity escaped and UTF-8 compliant.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 422 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base
$base = '/v1/people/~/person-activities';
// Build the xml.
$xml = '<activity locale="en_US">
<content-type>linkedin-html</content-type>
<body>' . $body . '</body>
</activity>';
$header['Content-Type'] = 'text/xml';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinStream::reshare (   $visibility,
  $id,
  $comment = null,
  $twitter = false 
)

Method to reshare an existing share.

Paramètres:
string$visibilityOne of anyone: all members or connections-only: connections only.
string$idThe unique identifier for a share.
string$commentText of member's comment.
boolean$twitterTrue to have LinkedIn pass the status message along to a member's tethered Twitter account.
Renvoie:
array The decoded JSON response
Depuis:
13.1
Exceptions:
RuntimeException

Définition à la ligne 122 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base
$base = '/v1/people/~/shares';
// Check if twitter is true.
if ($twitter)
{
$base .= '?twitter-post=true';
}
// Build xml.
$xml = '<share>
<visibility>
<code>' . $visibility . '</code>
</visibility>';
// Check if comment specified.
if ($comment)
{
$xml .= '<comment>' . $comment . '</comment>';
}
$xml .= ' <attribution>
<share>
<id>' . $id . '</id>
</share>
</attribution>
</share>';
// Build the request path.
$path = $this->getOption('api.url') . $base;
$header['Content-Type'] = 'text/xml';
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinStream::share (   $visibility,
  $comment = null,
  $title = null,
  $url = null,
  $image = null,
  $description = null,
  $twitter = false 
)

Method to add a new share. Note: post must contain comment and/or (title and url).

Paramètres:
string$visibilityOne of anyone: all members or connections-only: connections only.
string$commentText of member's comment.
string$titleTitle of shared document.
string$urlURL for shared content.
string$imageURL for image of shared content.
string$descriptionDescription of shared content.
boolean$twitterTrue to have LinkedIn pass the status message along to a member's tethered Twitter account.
Renvoie:
array The decoded JSON response
Depuis:
13.1
Exceptions:
RuntimeException

Définition à la ligne 37 du fichier stream.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base
$base = '/v1/people/~/shares';
// Check if twitter is true.
if ($twitter)
{
$base .= '?twitter-post=true';
}
// Build xml.
$xml = '<share>
<visibility>
<code>' . $visibility . '</code>
</visibility>';
// Check if comment specified.
if ($comment)
{
$xml .= '<comment>' . $comment . '</comment>';
}
// Check if title and url are specified.
if ($title && $url)
{
$xml .= '<content>
<title>' . $title . '</title>
<submitted-url>' . $url . '</submitted-url>';
// Check if image is specified.
if ($image)
{
$xml .= '<submitted-image-url>' . $image . '</submitted-image-url>';
}
// Check if descrption id specified.
if ($description)
{
$xml .= '<description>' . $description . '</description>';
}
$xml .= '</content>';
}
elseif (!$comment)
{
throw new RuntimeException('Post must contain comment and/or (title and url).');
}
$xml .= '</share>';
// Build the request path.
$path = $this->getOption('api.url') . $base;
$header['Content-Type'] = 'text/xml';
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinStream::unlike (   $key)

Method used to unlike an update.

Paramètres:
string$keyUpdate/update-key representing an update.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 623 du fichier stream.php.

{
return $this->_likeUnlike($key, false);
}

La documentation de cette classe a été générée à partir du fichier suivant :