I'm using this code to pull the name and emails of my users into an intranet page on Google Sites. I was just wondering, is there some code that I can add to this so I can retrieve pictures? I would imagine it goes in below flexTable.setWidget(parseInt(i), 1, app.createLabel(user.getEmail()));
but I'm not sure what I can add there to retrieve their picture from their profile. I would also like to do the same for phone number.
function doGet() {
var app = UiApp.createApplication();
var users = UserManager.getAllUsers();
var flexTable = app.createFlexTable().setBorderWidth(1);
for (var i=0, len=users.length; i<len; i++) {
var user = users[i];
flexTable.setWidget(parseInt(i), 0, app.createLabel(user.getGivenName()
+ ' ' + user.getFamilyName()));
flexTable.setWidget(parseInt(i), 1, app.createLabel(user.getEmail()));
}
app.add(flexTable);
return app;
}
Edit: I tried adding flexTable.setWidget(parseInt(i), 2, app.createLabel(user.getPhones()));
but that gives me an error in the code. I got this from the API reference for scripts.