Google apps script 我可以在Google Drive服务器infra上执行代码吗?

Google apps script 我可以在Google Drive服务器infra上执行代码吗?,google-apps-script,google-drive-api,Google Apps Script,Google Drive Api,Google Drive API是否提供了在Google Drive服务器infra上执行我的代码的方法 比如说,我想编写基于Google Dirve的grep,让客户搜索他们的文件。 我想能够写这样的东西:(非常简单,让它简短) 有很多应用程序类型可以利用这种方法。简单的数据库管理器是另一个例子。有,而且非常接近您想要的。我认为谷歌硬盘没有这个功能 /* define the function for grep */ var grep = function(params, callback)

Google Drive API是否提供了在Google Drive服务器infra上执行我的代码的方法

比如说,我想编写基于Google Dirve的
grep
,让客户搜索他们的文件。 我想能够写这样的东西:(非常简单,让它简短)

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

有,而且非常接近您想要的。我认为谷歌硬盘没有这个功能

/* 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)
  }
);