1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="List Friends Example">
    <Require feature="opensocial-0.8"/>
  </ModulePrefs>
  <Content type="html">
  <![CDATA[
    <!-- ALm6fM3Zp90MFN6OfkJXfxMqtVaPs_S5NPgKn_Gp25Fa_TCAxNg-iJBmmIlj34j0qLjGsd61ic9gXxrxLW8-JF5S3wKa1ifJFr0OrMvQCkr7GdgM9qNcpAY= -->
    <script type="text/javascript">
      /**
       * Request the OWNER and OWNER's friends.
       */
      function request() {
        var idspec = opensocial.newIdSpec({ "userId" : "OWNER", "groupId" : "FRIENDS" });
        var req = opensocial.newDataRequest();
        req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), "get_owner");
        req.send(response);
      };

      function response(dataResponse) {
        document.getElementById('message').innerHTML = dataResponse.get('get_owner').getData().getId();
      };

      // Execute the request function when the application is finished loading.
      gadgets.util.registerOnLoadHandler(request);

    </script>
    <div id="message"> </div>
  ]]>
  </Content>
</Module>