Hi Kalyan,
OK, I got it!!
I had to publish it and then get the URL and add it as an application
into Orkut to see it.
Now I need to see how to build my own container.
Thanks,
Sree
On Dec 5, 3:21 pm, "Kalyan Lanka" <[EMAIL PROTECTED]> wrote:
> Hi Sree,
>
> Checked your code and after replacing UID with 'VIEWER' Role, it is
> working fine. Here is the code
> <?xml version="1.0" encoding="UTF-8"?>
> <Module>
> <ModulePrefs title="People API Howto">
> <Require feature="opensocial-0.5" />
> </ModulePrefs>
> <Content type="html"><![CDATA[
> <SCRIPT type="text/javascript">
> _IG_RegisterOnloadHandler(request);
>
> function request() {
>
> var req=opensocial.newDataRequest();
>
> req.add(req.newFetchPersonRequest('VIEWER'),'viewer');
> req.send(response);
>
> };
>
> function response(dataResponse) {
> var viewer=dataResponse.get('viewer').getData();
> var name = viewer.getDisplayName();
> var thumb = viewer.getField(opensocial.Person.Field.THUMBNAIL_URL);
> var profile = 'http://sandbox.orkut.com'+
> viewer.getField(opensocial.Person.Field.PROFILE_URL);
>
> var html = '<img src="' + thumb + '"/>' + '<a href="' + profile + '">'
> + name + '</a>'
>
> document.getElementById('main').innerHTML = html;
>
> };
>
> </SCRIPT>
> <div id="main"> </div>
> ]]></Content>
> </Module>
>
> Thanks
> Kalyan
>
> On Dec 4, 2007 9:50 PM, Sree <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > Can you please help me! Where do I specify the profile id?
> > How does the sample code below knows which profile I am accessing?
> > I tried replacing the word VIEWER with the sandbox uid but empty
> > results.
>
> > Thanks,
> > Sree
>
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <Module>
> > <ModulePrefs title="People API Howto">
> > <Require feature="opensocial-0.5" />
> > </ModulePrefs>
> > <Content type="html">
> > <![CDATA[
>
> > <script type="text/javascript">
> > _IG_RegisterOnloadHandler(request);
>
> > function request() {
> > var req = opensocial.newDataRequest();
> > req.add(req.newFetchPersonRequest("4694083120338855923"), "viewer");
> > req.send(response);
> > }
>
> > function response(data) {
> > var viewer = data.get("viewer").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;
> > }
>
> > </script>
> > <div id='main'/>
> > ]]>
> > </Content>
> > </Module>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Orkut Discussion" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---