|
birthday
<?xml version="1.0" encoding="UTF-8"?> <module> <moduleprefs title="birthdayexample"></moduleprefs>
req.send(onLoadFriends); }// Retrieves owner location details ========================================== / function getLocationDetails() {var req = opensocial.newDataRequest(); var params = {}; params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =};[opensocial.Person.Field.CURRENT_LOCATION];req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER, params), "owner"); req.send(callback); function callback(data) {if (data.hadError()) {};alert("There was a problem: " + data.getErrorMessage());} else {var owner = data.get("owner").getData(); var ownerLocation = owner.getField(opensocial.Person.Field.CURRENT_LOCATION); output(ownerLocation.getField(opensocial.Address.Field.COUNTRY)); output(ownerLocation.getField(opensocial.Address.Field.LATITUDE)); output(ownerLocation.getField(opensocial.Address.Field.LOCALITY)); output(ownerLocation.getField(opensocial.Address.Field.LONGITUDE)); output(ownerLocation.getField(opensocial.Address.Field.REGION));}
function init() {alert("Hello world"); getLocationDetails();} gadgets.util.registerOnLoadHandler(init);
]]> </content> </module>
|