3 messages in com.googlegroups.opensocial-apiRe: [OpenSocial] Re: how to get onlin...
FromSent OnAttachments
ritu11 Dec 2007 21:24 
Dustin Jorge12 Dec 2007 10:03 
ruchi kothari12 Dec 2007 21:06 
Subject:Re: [OpenSocial] Re: how to get online friends list
From:ruchi kothari (kruc@gmail.com)
Date:12/12/2007 09:06:23 PM
List:com.googlegroups.opensocial-api

Hi Dustin,

I want to get only online friends of the owner. Can U help me?

Thanx

On Dec 12, 2007 11:33 PM, Dustin Jorge <dust@gmail.com> wrote:

To get OWNER_FRIENDS use something like this:

var reqObj = opensocial.newDataRequest(); reqObj.add( reqObj.newFetchPeopleRequest("OWNER_FRIENDS"),'friends'); reqObj.send( handleReturn );

function handleReturn( dat ){ if(dat.get('friends').hadError()){ //**** do some error handling return; } var friends = dat.get('friends').getData(); //**** friends is now of the type: opensocial.Collection //**** Reference here:

http://code.google.com/apis/opensocial/docs/javascript/reference/opensocial.Collection.html //**** Example: var html = ""; friends.each( function( Person ){ html+=Person.getField(opensocial.Person.Field.NAME<http://opensocial.person.field.name/> ); }); document.write(html); }

If you want to get only owner friends who are currently online, that's another story.

Martin Selva wrote:

I doubt its possible now. But later on once final api is out. you might be able to get this by Profile Details.

On Dec 12, 2007 10:54 AM, ritu < ruch@gmail.com <mailto:ruch@gmail.com>> wrote:

Hi,

I want to get all online friends of owner. Is it possible?

Thanx