Hi Here I am submitting the code to Retrieve friends from Mumbai. I got a problem in retrieving Current location data. Please help me in correcting it
function init() { loadFriends(); } function loadFriends() { var req = opensocial.newDataRequest(); var params = {}; params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = [opensocial.Person.Field.CURRENT_LOCATION]; req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER, params), 'viewer'); req.add(req.newFetchPeopleRequest(opensocial.DataRequest.Group.VIEWER_FRIENDS, params), 'viewerFriends'); req.send(onLoadFriends); } function onLoadFriends(data) { var viewer = data.get('viewer').getData(); var viewerFriends = data.get('viewerFriends').getData(); var count=0; html = new Array(); html.push('<ul>'); viewerFriends.each(function(person) { alert(person.getDisplayName()); var address = person.getField(opensocial.Person.Field.CURRENT_LOCATION); var country = address.getField(opensocial.Address.Field.LOCALITY); alert(country); if(address!=null) { var country = address.getField(opensocial.Address.Field.LOCALITY); if((country.toString()).toUpperCase()=='MUMBAI'|| (country.toString()).toUpperCase()=='BOMBAY') { html.push('<li>' +person.getDisplayName() + "</li>"); count=count+1; } } }); html.push('</ul>'); var html2=new String("Number of friends from Mumbai are:"); html2=html2+count; document.getElementById('numoffriends').innerHTML=html2; document.getElementById('friends').innerHTML = html.join(''); } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to opensocial-orkut@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en -~----------~----~----~----~------~----~------~--~---