简体   繁体   English

如何使用Dropbox Core API获取修订后的文本文件的内容详细信息?

[英]How can I get the content details of a revised text file using Dropbox Core API?

I need my node.js app to fetch the net revised portion of a single text file, using dropbox-js library. 我需要我的node.js应用程序使用dropbox-js库来获取单个文本文件的净修订部分。

I think I searched the Core API documentation quite thoroughly but I couldn't find the reference I wanted and already checked the following posts. 我想我已经彻底搜索了Core API文档,但找不到所需的参考,并且已经检查了以下帖子。

What I am expecting is the actual text content difference between the current revision and the one previously made. 我期望的是当前修订版与先前修订版之间的实际文本内容差异。

I guess I could just listen for changes using the /longpoll_delta endpoint and manually check for differences using readFile, but I would like to know if there's a much simpler way to achieve this. 我想我可以使用/ longpoll_delta端点监听更改,并使用readFile手动检查差异,但是我想知道是否有更简单的方法来实现这一点。

Update: I just realized I can harness the rev or versionTag param when using readFile however it's still fetching the whole text file not the revised content. 更新:我刚刚意识到我可以在使用readFile时利用rev或versionTag参数,但是它仍在获取整个文本文件而不是修订的内容。 Here's my code: 这是我的代码:

module.exports.getFile = (callback) ->
  options = {}
  options.rev = '1942a704479aca'
  client.readFile 'todo.txt', options, (err, data) ->
    if err
      throw err
    callback data

If I understand correctly what you're asking for, Dropbox doesn't provide this. 如果我正确理解您的要求,Dropbox不会提供此功能。 Dropbox will give you both versions of the file via the API, but Dropbox doesn't have an API for diffing two text files. Dropbox将通过API为您提供文件的两个版本,但是Dropbox没有用于区分两个文本文件的API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM