我可以在Google云端硬盘服务器上执行代码吗?

时间:2013-06-22 01:57:11

标签: google-apps-script google-drive-api

Google Drive API是否提供了在下面的Google云端硬盘服务器上执行我的代码的方法?

假设我想写一个基于{Drive grep的Google Dirve来让客户搜索他们的文件。 我希望能够写出这样的东西:(非常简化以简化它)

/* define the function for grep */
var grep = function(params, callback) {
  // 1) find all text files using `gapi.client.drive.files.list`
  // 2) open each file with `gapi.client.drive.files.get`
  // 3) scan for the serach string occurance
  callback(search_result);
}

/* register the code on the server with imaginary API */
gapi.client.drive.server.register('myapp.grep', grep);

/* execute from Browser */
gapi.client.drive.server.myapp.grep({searchString: 'Abrakadabra', mimeType: 'application/javascript'},
  function(resutls) {
    console.log(results)
  }
);

有很多应用程序类型可以利用这种方法。 简单数据库管理器是另一个例子。

1 个答案:

答案 0 :(得分:3)

Google Apps ScriptGoogle App Engine与你想要的一样安静。我不认为Google云端硬盘具有该功能。

相关问题