Forum is closed

Retrieve/update of a member connections and post to them.

Retrieve/update of a member connections and post to them.

I would like for each member who registred with linkedin or are logged in with Linkedin to:

- Retrieve his/her 1st level connections through the Linkedin's Connections API (https://developer.linkedin.com/document … ions-api).
- Update his/her 1st level connections through the Linkedin's Get Network Updates API (https://developer.linkedin.com/document … tics-api).
- Post messages on his/her behalf to his/her 1st connections using the Post Network Update function of Linkedin (https://developer.linkedin.com/document … k-update).

Is that possible to do it using Jlinked and, if yes, can you briefly explain how to proceed in order to let me figure if it is complicated or not ?

Edited by: Toni - Oct-04-13 06:53:43
Toni
useravatar
Offline
2 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Retrieve/update of a member connections and post to them.

I misplaced this thread: this is a pre-sales question...

Edited by: Toni - Oct-04-13 11:42:46
Toni
useravatar
Offline
2 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Retrieve/update of a member connections and post to them.

Toni,
I'll move this to the Pre-Sales form after I post, so look for it there.

Getting a user's connections isn't something we support directly right now. We are considering some integration to automatically make 'friends' in JomSocial and other Joomla extensions in the future though. To get a user's connections with that API is actually just a few lines of code you could implement like:

Code:

$profileLibrary = JLinkedProfileLibrary::getInstance();

$liUser = $profileLibrary->fetchProfile($liMemberId, array('connections'));
$connections = $liUser->get('connections');

From there, you'll have an array of their connections. I haven't tested that code directly, but it should just work. Beyond that, you'd need to store it in a database, write it to a file or do whatever you want with it.

- Update his/her 1st level connections through the Linkedin's Get Network Updates API

We don't support the Get Network Updates API currently and this would take some work to add.

- Post messages on his/her behalf to his/her 1st connections using the Post Network Update function of Linkedin

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:

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.

So, you can't just post on behalf of the user when joining your site or something else without them allowing/denying the message.

I hope that helps explain,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24020 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Retrieve/update of a member connections and post to them.

Hi Alex,

I had to subscribe your product with an other account. For this reason I am continuing this thread with an other username.

First of all, thanks for your answer.

I have several other question:

alzander wrote:


To get a user's connections with that API is actually just a few lines of code you could implement like:

Code:

$profileLibrary = JLinkedProfileLibrary::getInstance();

$liUser = $profileLibrary->fetchProfile($liMemberId, array('connections'));
$connections = $liUser->get('connections');

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 ?

alzander wrote:


- Post messages on his/her behalf to his/her 1st connections using the Post Network Update function of Linkedin

Posting a message, as above, is a few lines of code.

What I want to do is to post a message when submitting a form managed with the 'fabrik' component. With this extension, I can include some php code to be executed 'on form submit'.

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...)


alzander wrote:


However, you'd need to make sure you strictly adhere to LinkedIn's policies, specifically:

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.

So, you can't just post on behalf of the user when joining your site or something else without them allowing/denying the message.

I am aware of this. I will probably include an 'opt in' checkbox in my form and the code to post the message will only be executed if the box is checked.

alzander wrote:


- Update his/her 1st level connections through the Linkedin's Get Network Updates API

We don't support the Get Network Updates API currently and this would take some work to add.

Can you at least give me some guidelines on how to proceed.

best regards.

Edited by: keroman - Oct-08-13 06:44:29
keroman
useravatar
Offline
2 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Retrieve/update of a member connections and post to them.

Friendly bump...

keroman
useravatar
Offline
2 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: Retrieve/update of a member connections and post to them.

Apologies for the delay. Hopefully, the answers below get you going, but if not, let us know.

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 ?

In JLinked, you can put that code in the /components/com_jlinked/controllers/loginregister.php file. In there, around line 195, you'll see:

Code:

        $loginRegisterModel = $this->getModel('LoginRegister', 'JLinkedModel');

        $redirect = $loginRegisterModel->getLoginRedirect();

If you add the code directly after those lines, it will get executed on every login of a user from LinkedIn. Test the code, again, as mentioned, to make sure it works. Additionally, that will get the connections.. but you'll need to 'do' something with them (like store in a database or a file or wherever you want that data to go).

For Facebook, the code to get a user's connections is:

Code:

$fbUserId = JFBCFactory::provider('facebook')->getProviderUserId();

$connections = JFBCFactory::provider('facebook')->profile->fetchProfile($fbUserId, 'friends');

That will return an array of FB User Id's and names of the user's friends. You can add that to the /components/com_jfbconnect/controllers/login.php file around line 152, right after where you'll see:

Code:

        $redirect = $loginRegisterModel->getLoginRedirect($provider);
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...)

There isn't an easy call to do just post to a user's update. You'd need to make a call like below:

Code:

$jlinkedLibrary = JLinkedApiLibrary::getInstance();

$return = $jlinkedLibrary->api('people', '~/person-activities:(activity=xyz,body=yyy');

I've never tested that, and you'll need to make sure you read over the document you posted above for more information on how to do that.

We don't support the Get Network Updates API currently and this would take some work to add.

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.

I hope that helps,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24020 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11613
Total Polls:
0
Total Posts:
48804
Posts today:
7
User Info
 
Total Users:
47660
Newest User:
ethicalhuman
Members Online:
1
Guests Online:
838

Online: 
ramonmedina
Social Stream
SourceCoast Joomla Social Extensions
Friday, 25 May 2018
JFBConnect 8.0 Coming Soon! Stay tuned.
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program