$profileLibrary = JLinkedProfileLibrary::getInstance();
$liUser = $profileLibrary->fetchProfile($liMemberId, array('connections'));
$connections = $liUser->get('connections');
We don't support the Get Network Updates API currently and this would take some work to add.- Update his/her 1st level connections through the Linkedin's Get Network Updates API
Posting a message, as above, is a few lines of code. However, you'd need to make sure you strictly adhere to LinkedIn's policies, specifically:- Post messages on his/her behalf to his/her 1st connections using the Post Network Update function of Linkedin
So, you can't just post on behalf of the user when joining your site or something else without them allowing/denying the message.The user must be given a choice about whether to send the message. The user must opt into the messages being sent rather than opt out.
alzander wrote: To get a user's connections with that API is actually just a few lines of code you could implement like:
$profileLibrary = JLinkedProfileLibrary::getInstance(); $liUser = $profileLibrary->fetchProfile($liMemberId, array('connections')); $connections = $liUser->get('connections');
alzander wrote:
Posting a message, as above, is a few lines of code.- Post messages on his/her behalf to his/her 1st connections using the Post Network Update function of Linkedin
alzander wrote: However, you'd need to make sure you strictly adhere to LinkedIn's policies, specifically:
So, you can't just post on behalf of the user when joining your site or something else without them allowing/denying the message.The user must be given a choice about whether to send the message. The user must opt into the messages being sent rather than opt out.
alzander wrote:
We don't support the Get Network Updates API currently and this would take some work to add.- Update his/her 1st level connections through the Linkedin's Get Network Updates API
In JLinked, you can put that code in the /components/com_jlinked/controllers/loginregister.php file. In there, around line 195, you'll see:where should these lines of code be included ?
I also need to record the facebook friends of a user when he register on the site. Which code has to be used to get an array of a user's friends and, again, where should I put it ?
$loginRegisterModel = $this->getModel('LoginRegister', 'JLinkedModel');
$redirect = $loginRegisterModel->getLoginRedirect();
$fbUserId = JFBCFactory::provider('facebook')->getProviderUserId();
$connections = JFBCFactory::provider('facebook')->profile->fetchProfile($fbUserId, 'friends');
$redirect = $loginRegisterModel->getLoginRedirect($provider);
There isn't an easy call to do just post to a user's update. You'd need to make a call like below:Which code should I use to have access to JLinked library and to post a message using the 'Post Network Update' API ? (there is no developer doc such as the one of JFBConnect...)
$jlinkedLibrary = JLinkedApiLibrary::getInstance();
$return = $jlinkedLibrary->api('people', '~/person-activities:(activity=xyz,body=yyy');
Right now, I don't have any suggestions on this. You'd need to add an endpoint for LinkedIn to call and process those updates. It's not something I can just give a line of code for. We do have plans to support 'automatic updates' from both LinkedIn and Facebook in a future update, hopefully around the beginning of next year.We don't support the Get Network Updates API currently and this would take some work to add.
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.