is there a better way to get the result data from an osapi request?

i don't like grabbing the @viewer or @owner data this way.

it would be nice if there was an api call to grab the OwnerId or the ViewerId.

        osapi.appdata.get(  {'userId': '@viewer', 'appId':'@app', 'fields':keys 
} )
                                .execute(function(result){
                                        console.log('"appdata response"');
                                        console.log(result, keys);
                                        
                                        //this is a weird way to access the 
@owner without knowing the name.
                                        //it's an associative array, length, 
pop, or index won't work
                                        var appdata = {};
                                        for(var n in result){
                                                appdata = result[n];  //for the 
viewer/ first record
                                                console.log( n, result[n], 
result );
                                                break;
                                        }

-- 
--
--
Justin Kruger
Social Media Software Engineer -
San Francisco, CA

--
http://twitter.com/jdavid
http://www.linkedin.com/in/jdavid

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" 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-api?hl=en.

Reply via email to