Check out my repository hosted at GitHub for a suitable script in PHP. Below is an example for Google Apps Script in combination with the mentioned script on GitHub.
function getPageRank() {
// Generate a log, then email it to the person who ran the script.
var response = UrlFetchApp.fetch("http://cdn.florianbussmann.de/github/pagerank/script.php");
Logger.log(response.getContentText());
var recipient = Session.getActiveUser().getEmail();
var subject = 'Fetched PageRank';
var body = Logger.getLog();
MailApp.sendEmail(recipient, subject, body);
}
Feel free to ask further questions.