Google Drive API是否提供了在Google Drive服务器基础设施上执行代码的方法?
比方说,我想写一个基于谷歌目录的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)
}
);
有很多应用程序类型可以利用这种方法Simple DB manager就是另一个例子。
有谷歌应用程序脚本和谷歌应用程序引擎,它们非常安静,接近你想要的。我认为谷歌硬盘没有这个功能。