MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Opensocial questions

Last post 05-13-2008 1:56 PM by Jeremy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-12-2008 6:22 PM

    • Cote
    • Not Ranked
    • Joined on 04-23-2008
    • Posts 2

    Opensocial questions

    Hey all, I'm new to developing opensocial/myspace apps and I've got a few questions that I can't find the answer to.

     

    1) I know that I can query myspace to get data for VIEWER and OWNER. Is it possible to query for a user id? 

    For example, user 1 and 2 have the app installed but are not friends with each other. However, I want to display  the uses pic and display name on the canvas page regardless of who is the owner of the app. 

     2) I need to keep track of when users add and delete the app to/from their profiles in an external database. Is there a built in way of doing this (i.e. a callback when "add this app" is selected)? If not, it's easy enough to code something up for a user add, but a delete would be trickier on the back end.

     Thanks in advance.

  • 05-12-2008 7:02 PM In reply to

    Re: Opensocial questions

    1. here is a code snipplet from my app that gets the owners id

    var owner = data.get(opensocial.DataRequest.PersonId.OWNER).getData(); 

    owner.getField(opensocial.Person.Field.ID);

    2. i believe that there are options for callback urls in the edit app info section.


    hope that helps. Smile 

  • 05-13-2008 7:53 AM In reply to

    • Cote
    • Not Ranked
    • Joined on 04-23-2008
    • Posts 2

    Re: Opensocial questions

     Thanks, Scoot. 

     re: User IDs

     I'm not having a problem with the owner or viewer id. My problem is that I want to get pictures from user x, who is neither the owner or the viewer. 

     

    re: callbacks

     I should've seen that. Thanks for pointing it out!

  • 05-13-2008 1:05 PM In reply to

    Re: Opensocial questions

    no prob

     

    and the only thing i can think of to ur reference to user x is i friend of the viewer or owner, which that would reference to groups in opensocial. and i am not even sure if you can do that. cause if the person is not a registered member or is logged out it would not be able to fetch anything of course and i am not even sure if the app would show. Big Smile 

  • 05-13-2008 1:56 PM In reply to

    Re: Opensocial questions

    Scoot's right about that -- you can't ask for information from an arbitrary user using an Id -- that user must either be the OWNER, VIEWER, or one of their Friends (if they are a friend, you can retrieve the friend data, then pull out the specific user with the (friendData).getUserById(uid) function).

    Otherwise, nope, you can't access any information about them with the OpenSocial container.

Page 1 of 1 (5 items)