How get User uid in orkut

2 views
Skip to first unread message

prakash

unread,
Jul 11, 2008, 5:10:27 AM7/11/08
to OpenSocial - OpenSocial Application Development
Hello Friend

I am trying to access uid using
viewer.getField(opensocial.Person.Field.PROFILE_URL)
but i got error.
. but using getId() i got open social id. please tell me how to find
uid ??


thanks

yoichiro

unread,
Jul 11, 2008, 5:29:59 AM7/11/08
to OpenSocial - OpenSocial Application Development
Hi prakash,

In orkut, you can't get PROFILE_URL without using PROFILE_DETAILS. You
should pass the parameter of the PROFILE_DETAILS to newFetchPerson/
PeopleRequest() function.

var req = opensocial.newDataRequest();
var params = {};
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
[opensocial.Person.Field.PROFILE_URL];
req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER,
params), "viewer");

Best regards,
Yoichiro

Davi Sáránszky Mesquita

unread,
Jul 11, 2008, 9:15:59 AM7/11/08
to opensoc...@googlegroups.com
i am using the "Code Runner" Gadget ... and make this code.... it is very simple and u can get another field on API Reference

function response(data) {
  output("orkut.com:"+data.get("req").getData().getId());
  gadgets.window.adjustHeight();
};

function request() {
  var req = opensocial.newDataRequest();
  req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER), "req");
  req.send(response);
};

request();
--
Atenciosamente

Davi Sáránszky Mesquita
+55-11-81809411

yoichiro

unread,
Jul 12, 2008, 11:43:16 AM7/12/08
to OpenSocial - OpenSocial Application Development
Hi Davi,

The code described by you can get only basic information(ID, NAME and
THUMBNAIL_URL). We have to specify the PROFILE_DETAILS parameter for
retriving another fields of someone's profile.

Regards,
Yoichiro

On July 11, 10:15 pm, "Davi Sáránszky Mesquita"
<davimesqu...@gmail.com> wrote:
> i am using the "Code Runner" Gadget ... and make this code.... it is very
> simple and u can get another field on API Reference
>
> function response(data) {
> output("orkut.com:"+data.get("req").getData().getId());
> gadgets.window.adjustHeight();
>
> };
>
> function request() {
> var req = opensocial.newDataRequest();
> req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER),
> "req");
> req.send(response);
>
> };
>
> request();
>
Reply all
Reply to author
Forward
Message has been deleted
0 new messages