Hi,
I have copied and pasted from the examples. its a sample code that
returns the viewer's basic data.
I cant get it to work.
When i change:
                req.add(req.newFetchPersonRequest("VIEWER"),
"viewer");
            to
                req.add(req.newFetchPersonRequest("OWNER"),
"viewer");
I get the OWNERs info normaly, but i cant find a way to get the
viewer's data, like name and profile_url

can someone help me?

thanks.

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

function response(data) {
  var viewerItem = data.get("viewer");
  var viewer = viewerItem.getData();
  var name = viewer.getDisplayName();
  var thumb = viewer.getField(opensocial.Person.Field.THUMBNAIL_URL);
  var profile = viewer.getField(opensocial.Person.Field.PROFILE_URL);
  profile = 'http://sandbox.orkut.com' + profile;
  var html = '<img src="' + thumb + '"/>';
  html+='<a href="' + profile + '" target="_top">' + name + '</a>';
  document.getElementById('main').innerHTML = html;
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to