Hey Andre,

The solution is simpler then that, the batch request allows you to add
multiple different requests to it, so you can add a viewer activities
request to it, an owner activities request, and even mix in things like
owner and/or viewer friends all in one batch request.

The resulting collection of requests will be send to the social server in a
single request, and on completion all that data you've requested will be
available, so in this case you would do:

function getViewerActivities() {
   var req = opensocial.newDataRequest();
   var viewerSpec = opensocial.newIdSpec({
                   'userId':'VIEWER',
                   'groupId':'SELF'});
   var ownerSpec = opensocial.newIdSpec({
                   'userId':'OWNER',
                   'groupId':'SELF'});
   req.add(req.newFetchActivitiesRequest(
                   viewerSpec),
                   'viewerActivities');
   req.add(req.newFetchActivitiesRequest(
                    ownerSpec),
                   'ownerActivities');
   req.send(fetchActivitiesHandler);
}


   -- Chris

On Fri, Jun 26, 2009 at 5:05 AM, rarelegend <rareleg...@gmail.com> wrote:

>
> Greetings,
>
> I would like to know if it is possible, within opensocial v0.8, to
> call both VIEWER and FRIENDS activities in one activity fetch.
>
> For example, I am able to call the viewer's activities with the
> following script:
>
> function getViewerActivities() {
>    var req = opensocial.newDataRequest();
>    var idspec = opensocial.newIdSpec({
>                    'userId':'VIEWER',
>                    'groupId':'SELF'});
>    req.add(req.newFetchActivitiesRequest(
>                    idspec),
>                    'viewerActivities');
> req.send(fetchActivitiesHandler);
> }
>
> and something similar to fetch friends activities.  However, I would
> like to make one call for both so I'm able to display all in one
> sequence within my gadget.   I've seen in the docs the field
> 'opensocial.IdSpec.GroupId.ALL', however I am not sure if this field
> is relevant in my scenario.
>
> Thanks for the help,
>
> Andre
>
> >
>

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

Reply via email to