Fetch Friends

39 views
Skip to first unread message

Leonardo Rafael Morastoni

unread,
Nov 25, 2010, 6:44:13 AM11/25/10
to OpenSocial Client Libraries
How can I fecth more friends than 20? I need to compare a opensocial
id with all friends of the viewer.
I'm using java client library and OAuth

Robson Dantas

unread,
Nov 25, 2010, 8:00:32 AM11/25/10
to opensocial-cl...@googlegroups.com
Hi Leonardo!

Dont know if you are using 2legged or 3legged OAuth. For 3legged, just add a parameter called 'count' and then you are done.

Looking on wiki´s library example, to make a call you should do something like:

// Request the viewer's friends
Request viewerFriends = PeopleService.getFriends();


It sets:
request.setModelClass(Person.class);
request.setSelector(selector);
request.setGuid(guid);

So technically it should work like this:

// Request the viewer's friends
Request viewerFriends = PeopleService.getFriends();
viewerFriends.addParameter('count',400); //400 friends

It is also documented on this method description, see:

/**
   * Adds an extended request parameter, e.g. count or startIndex, to be passed
   * as query parameters in the URL if executed using REST or in the request
   * body if executed via a RPC.
   *
   * @param name  name of the extended parameter to set
   * @param value value of the specified extended parameter
   */
  public void addParameter(String name, String value) {
    addRpcPayloadParameter(name, value);
    addRestQueryStringParameter(name, value);
  }

Let us know if it works.

-Robson Dantas


2010/11/25 Leonardo Rafael Morastoni <leom...@gmail.com>
How can I fecth more friends than 20? I need to compare a opensocial
id with all friends of the viewer.
I'm using java client library and OAuth

--
You received this message because you are subscribed to the Google Groups "OpenSocial Client Libraries" group.
To post to this group, send email to opensocial-cl...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-client-l...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/opensocial-client-libraries?hl=en.


Leonardo Rafael Morastoni

unread,
Nov 25, 2010, 8:12:09 AM11/25/10
to opensocial-cl...@googlegroups.com
Thanks for response Robson!

I'm using 2Legged OAuth, it will work too?

Could please help me in other question? I post it on Orku Developer Group but I get no response yet.
How can I can send to opensocial id from viewer to my external java app?
Today, I just can see my opensocial id, that I need to conect to opensocial.

Thanks.

2010/11/25 Robson Dantas <biu.d...@gmail.com>



--
Leonardo Rafael Morastoni
Microsoft Certified Professional
Fone/Phone: +55(47) 8417-3306/+55(47) 8834-8415


Leonardo Rafael Morastoni

unread,
Nov 27, 2010, 10:53:40 AM11/27/10
to OpenSocial Client Libraries
Anybody knows how can I do it?

On Nov 25, 11:12 am, Leonardo Rafael Morastoni <leomo...@gmail.com>
wrote:
> Thanks for response Robson!
>
> I'm using 2Legged OAuth, it will work too?
>
> Could please help me in other question? I post it on Orku Developer Group
> but I get no response yet.
> How can I can send to opensocial id from viewer to my external java app?
> Today, I just can see my opensocial id, that I need to conect to opensocial.
>
> Thanks.
>
> 2010/11/25 Robson Dantas <biu.dan...@gmail.com>
>
>
>
> > Hi Leonardo!
>
> > Dont know if you are using 2legged or 3legged OAuth. For 3legged, just add
> > a parameter called 'count' and then you are done.
>
> > Looking on wiki´s library example, to make a call you should do something
> > like:
>
> > // Request the viewer's friends
> > Request viewerFriends = PeopleService.getFriends();
>
> > getFriends method is described here:
> >http://code.google.com/p/opensocial-java-client/source/browse/trunk/j...
>
> > It sets:
> > request.setModelClass(Person.class);
> > request.setSelector(selector);
> > request.setGuid(guid);
>
> > So technically it should work like this:
>
> > // Request the viewer's friends
> > Request viewerFriends = PeopleService.getFriends();
> > viewerFriends.addParameter('count',400); //400 friends
>
> > It is also documented on this method description, see:
>
> > /**
> >    * Adds an extended request parameter, e.g. count or startIndex, to be
> > passed
> >    * as query parameters in the URL if executed using REST or in the
> > request
> >    * body if executed via a RPC.
> >    *
> >    * @param name  name of the extended parameter to set
> >    * @param value value of the specified extended parameter
> >    */
> >   public void addParameter(String name, String value) {
> >     addRpcPayloadParameter(name, value);
> >     addRestQueryStringParameter(name, value);
> >   }
>
> > Let us know if it works.
>
> > -Robson Dantas
>
> > 2010/11/25 Leonardo Rafael Morastoni <leomo...@gmail.com>
>
> > How can I fecth more friends than 20? I need to compare a opensocial
> >> id with all friends of the viewer.
> >> I'm using java client library and OAuth
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "OpenSocial Client Libraries" group.
> >> To post to this group, send email to
> >> opensocial-cl...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> opensocial-client-l...@googlegroups.com<opensocial-client-libraries%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/opensocial-client-libraries?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "OpenSocial Client Libraries" group.
> > To post to this group, send email to
> > opensocial-cl...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > opensocial-client-l...@googlegroups.com<opensocial-client-libraries%2Bunsu...@googlegroups.com>
> > .

Robson Dantas

unread,
Nov 27, 2010, 11:36:19 AM11/27/10
to opensocial-cl...@googlegroups.com
Didnt understand as well what you are trying to do. Do you have a gadget installed on orkut and then you want to send viewer to your app ?

Leonardo Rafael Morastoni

unread,
Nov 27, 2010, 1:14:59 PM11/27/10
to opensocial-cl...@googlegroups.com
Robson

I can get the opensocial id following this tutorial: http://wiki.opensocial.org/index.php?title=Social_Application_Tutorial
I just need to create a servlet to capture this data on my app.
Do you know what i need to do to load my app on gadget? I had a URL based gadget but now this is out of orkut guideline. Changing it to html broke my gadget.
Thanks.

2010/11/27 Robson Dantas <biu.d...@gmail.com>

Leonardo Rafael Morastoni

unread,
Nov 28, 2010, 12:07:15 PM11/28/10
to opensocial-cl...@googlegroups.com
someone could help me please?

2010/11/27 Leonardo Rafael Morastoni <leom...@gmail.com>

Robson Dantas

unread,
Nov 28, 2010, 12:29:56 PM11/28/10
to opensocial-cl...@googlegroups.com
Please, switch to opensocial-br list. Someone can assist you in portuguese, and still not understanding what you want to do.

http://groups.google.com/group/opensocial-br?pli=1

-Robson Dantas

2010/11/28 Leonardo Rafael Morastoni <leom...@gmail.com>

Leonardo Rafael Morastoni

unread,
Nov 28, 2010, 12:36:23 PM11/28/10
to opensocial-cl...@googlegroups.com
Ok, thanks, I don't that br list exists.

2010/11/28 Robson Dantas <biu.d...@gmail.com>
Reply all
Reply to author
Forward
0 new messages