== Sample Code for Downloading User Photos on hi5, using hi5's !OpenSocial extensions == {{{ #!xml Hi5Kit.prototype.loadAlbums = function (viewer, callback) { var req = opensocial.newDataRequest(); req.add(hi5.newFetchAlbumsRequest("VIEWER"), "viewerAlbums"); Comment: For security purposes, we have hard coded the response to the newFetchAlbumsRequest() to only return the albums for the VIEWER of the application, regardless of the parameter set in the call that specifies which profile you want the photo album information for. req.send(function (data) { var albums = []; var viewerAlbums = data.get("viewerAlbums").getData(); viewerAlbums.each(function (album) { var photos = []; album.getPhotos().each(function (photo) { photos.push({ url: photo.getUrl() }); }); albums.push({ name: album.getName(), photos: photos }); }); callback(albums); }); } }}}