简体   繁体   中英

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.

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.

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.

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. 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 will give you both versions of the file via the API, but Dropbox doesn't have an API for diffing two text files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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