Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added supports of /shares and /media #33

Merged
merged 8 commits into from

3 participants

Satoshi Nakamura Matt Tagg Evan Meagher
Satoshi Nakamura

This patch adds supports of /shares and /media.

snakamura added some commits
Satoshi Nakamura snakamura Merge branch 'sandbox' 76d0703
Satoshi Nakamura snakamura Fixed put didn't work.
Because DropboxClient.put conflicted with a convenience methods, it didn't work. I renamed the convenience methods.
56e8347
Satoshi Nakamura snakamura Removed documents about Stream-based downloading because it's no long…
…er available.
be29119
Satoshi Nakamura snakamura Allowed to specify the root. ea82988
Satoshi Nakamura snakamura Fixed put didn't work.
Because DropboxClient.put conflicted with a convenience methods, it didn't work. I renamed the convenience methods.
9bb2570
Satoshi Nakamura snakamura Merge branch 'master' of github.com:snakamura/dropbox-node f79345a
Satoshi Nakamura snakamura Merge remote-tracking branch 'upstream/master'
Conflicts:
	lib/dropbox-node.js
a50848c
Satoshi Nakamura snakamura Added DropboxClient#shares and media. cea354f
Satoshi Nakamura

Oops, it contains a lot of unrelated patches. Sorry. Please see this patch.
snakamura@cea354f

Matt Tagg

Nice addition. Going to merge back with Evan's master?

Evan Meagher evnm merged commit a6682c8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 26, 2012
  1. Satoshi Nakamura

    Merge branch 'sandbox'

    snakamura authored
  2. Satoshi Nakamura

    Fixed put didn't work.

    snakamura authored
    Because DropboxClient.put conflicted with a convenience methods, it didn't work. I renamed the convenience methods.
Commits on Jul 5, 2012
  1. Satoshi Nakamura
  2. Satoshi Nakamura

    Allowed to specify the root.

    snakamura authored
  3. Satoshi Nakamura

    Fixed put didn't work.

    snakamura authored
    Because DropboxClient.put conflicted with a convenience methods, it didn't work. I renamed the convenience methods.
  4. Satoshi Nakamura
  5. Satoshi Nakamura

    Merge remote-tracking branch 'upstream/master'

    snakamura authored
    Conflicts:
    	lib/dropbox-node.js
Commits on Jul 12, 2012
  1. Satoshi Nakamura
This page is out of date. Refresh to see the latest.
Showing with 36 additions and 0 deletions.
  1. +10 −0 README.md
  2. +26 −0 lib/dropbox-node.js
10 README.md
View
@@ -149,6 +149,16 @@ https://www.dropbox.com/developers/reference/api#thumbnails
Downloads a thumbnail image located at `filepath`. Like `getFile()`, the `callback` can get buffered data or the returned readable stream can be piped. `optargs` can take `format` and `size` fields.
+### DropboxClient#shares(path, [optargs], [callback(err, link)])
+https://www.dropbox.com/developers/reference/api#shares
+
+Creates and gets a link to file/folder specified by `path`.
+
+### DropboxClient#media(filepath, [optargs], [callback(err, link)])
+https://www.dropbox.com/developers/reference/api#media
+
+Creates and gets a direct link to file specified by `filepath`.
+
### DropboxClient#copy(from_path, to_path, [optargs], callback)
https://www.dropbox.com/developers/reference/api#fileops-copy
26 lib/dropbox-node.js
View
@@ -190,6 +190,32 @@ DropboxClient.prototype.getThumbnail = function(path, optargs, cb) {
}
+// Creates and gets a link to the specified file or folder.
+// See https://www.dropbox.com/developers/docs/api#shares for explanation
+// of arguments.
+DropboxClient.prototype.share = function(path, optargs, cb) {
+ if (typeof optargs == 'function') cb = optargs, optargs = {};
+ optargs = optargs || {};
+ var uri = API_URI + '/shares/' + this.root + '/' + escapePath(path) +
+ '?' + stringifyParams(optargs);
+
+ return this._post(uri, optargs, cb);
+}
+
+
+// Creates and gets a direct link to the specified file.
+// See https://www.dropbox.com/developers/docs/api#media for explanation
+// of arguments.
+DropboxClient.prototype.media = function(path, optargs, cb) {
+ if (typeof optargs == 'function') cb = optargs, optargs = {};
+ optargs = optargs || {};
+ var uri = API_URI + '/media/' + this.root + '/' + escapePath(path) +
+ '?' + stringifyParams(optargs);
+
+ return this._post(uri, optargs, cb);
+}
+
+
// Copies a file or folder to a new location.
// See https://www.dropbox.com/developers/docs#fileops-copy for explanation
// of arguments.
Something went wrong with that request. Please try again.