MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

How to read movies, music, book etc info of FRIENDs?

Last post 02-20-2008 10:37 AM by Chad Russell. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 02-08-2008 2:39 AM

    How to read movies, music, book etc info of FRIENDs?

    Is OpenSocial 0.7 yet supported? I am NOT able to read user's fields like movies, music, book etc.

    OpenSocial 0.6 does NOT support reading fields like movies, music, book etc (but 0.7 does).

    Any idea how to read them for MySpace? :(

    It does NOT throw any errors, but it returns 'undefiend' :( 

     

     

  • 02-08-2008 2:26 PM In reply to

    Re: NOT able to read movies, music, book etc

    Hi, i'm not exactly sure if this helps but if you're looking to get the extended user's info here's how i do it. you can use a debugger to see the results but movies, music and books are all there. Let me know if you need anything else.

     

    -Robby

    <script>

    var os = null;

    var dataReqObj = null;

    function init(){os = opensocial.Container.get();

    dataReqObj = os.newDataRequest();

    getOwner();

    }

    function getOwner(){var params = {};

    params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [];

    params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS][ 0 ] = "BOOKS";

    var viewerReq = os.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER, params);

    dataReqObj.add(viewerReq);

     

    dataReqObj.send(viewerResponse);

    }

    function viewerResponse(data){var viewer = data.get(opensocial.DataRequest.PersonId.OWNER).getData();

     

    // Get data from the viewer

    alert( viewer.getField(MyOpenSpace.Person.Field.BOOKS) );

    }

    init();

    </script>

  • 02-10-2008 11:18 PM In reply to

    Re: NOT able to read movies, music, book etc

     

    Thanks Robby.

    But this shows error. Most likely due to this line :(

    params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [;

     

    I made it ....

    params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [;

    error is gone.

    But still NO luck :(

     

     

  • 02-11-2008 4:18 AM In reply to

    Re: NOT able to read movies, music, book etc

    Got it. It was available 'somewhere' on documentation pages ;)

    Here's link. Look for  "working app 4 : Getting MySpace Specific Profile Fields" on this page.

     http://developer.myspace.com/community/opensocial/myspace_extensions.aspx

     

    Add fields as per requirements to this:- param[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS]

    And read it inside callback function, like this:-  var movies = viewer.getField(MyOpenSpace.Person.Field.MOVIES);

  • 02-13-2008 12:29 AM In reply to

    How to read movies, music, book etc info of FRIENDs?

    Earlier I had problem reading profile information of VIEWER/OWNER etc. I was able to solve that, but now I am running into trouble of reading similar information for OWNER_FRIENDS / VIEWER_FRIENDS. 

     I am able to read ID/NAME/THUMBNAIL_URL only. How can I read MUSIC/MOVIES/BOOKS etc fields?

    Can someone out there show a sample code which would get MUSIC/MOVIES/BOOKS etc for OWNER_FRIENDS/VIEWER_FRIENDS as well???

     Thanks in advance :) 

    Filed under:
  • 02-15-2008 12:59 PM In reply to

    Re: How to read movies, music, book etc info of FRIENDs?

     Hi,

     If you try out my sample posted above you should get the extended information. You must pass in one of the extended properties to the params to get the data back. In this case I was using "BOOKS' which returns all of the extended fields.

     Robby!

  • 02-15-2008 2:34 PM In reply to

    Re: How to read movies, music, book etc info of FRIENDs?

    Hi, sorry, you can't get extended info of owner and viewer friends at this time. 

  • 02-19-2008 4:03 AM In reply to

    Re: How to read movies, music, book etc info of FRIENDs?

    Thanks. But please post it on forum whenever it is supported.

  • 02-20-2008 10:37 AM In reply to

    Re: How to read movies, music, book etc info of FRIENDs?

    Will do. 

Page 1 of 1 (9 items)