App-dropboxapi

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

### 1-a) FreeBSD

```
pkg_add -r dropbox-api-command
```

### 1-b) Ubuntu

```
sudo apt-get install make gcc libssl-dev wget
wget https://raw.github.com/miyagawa/cpanminus/master/cpanm
sudo perl cpanm App::dropboxapi
```

### 1-c) CentOS

```
# CentOS 5
sudo yum install gcc gcc-c++ openssl-devel wget
# CentOS 6
sudo yum install gcc gcc-c++ openssl-devel wget perl-devel
wget https://raw.github.com/miyagawa/cpanminus/master/cpanm
sudo perl cpanm App::dropboxapi
```

### 1-d) OS X

```
# Install Command Line Tools for Xcode
open https://www.google.com/search?q=Command+Line+Tools+for+Xcode

curl -O https://raw.github.com/miyagawa/cpanminus/master/cpanm
sudo perl cpanm App::dropboxapi
```

## 2. Get API Key and API Secret

```perl
https://www.dropbox.com/developers
My Apps => Create an App
```

## 3. Get Access Token and Access Secret

```
> dropbox-api setup
Please Input API Key: ***************
Please Input API Secret: ***************
1. Open the Login URL: https://www.dropbox.com/oauth2/authorize?client_id=*****&response_type=code
2. Input code and press Enter: ***************
success! try
> dropbox-api ls
> dropbox-api find /
```

## 4. How to use Proxy

Please use -e option.

```
> HTTP_PROXY="http://127.0.0.1:8888" dropbox-api setup -e
```

# Sub Commands

## help

disp help.

- syntax

    dropbox-api help \[<command>\]

### Example

```perl
> dropbox-api help
Usage: dropbox-api <command> [args] [options]

Available commands:
    setup get access_key and access_secret
    ls    list directory contents
    find  walk a file hierarchy
    du    disk usage statistics
    cp    copy file or directory
    mv    move file or directory
    mkdir make directory (Create intermediate directories as required)
    rm    remove file or directory (Attempt to remove the file hierarchy rooted in each file argument)
    put   upload file
    get   download file
    sync  sync directory (local => dropbox or dropbox => local)

Common Options
    -e enable env_proxy ( HTTP_PROXY, NO_PROXY )
    -D enable debug
    -v verbose
    -s sandbox mode, but this option has been removed.

See 'dropbox-api help <command>' for more information on a specific command.
```

### Example ( command help )

```
> dropbox-api help ls
Name
    dropbox-api-ls - list directory contents

SYNOPSIS
    dropbox-api ls <dropbox_path> [options]

Example
    dropbox-api ls Public
    dropbox-api ls Public -h
    dropbox-api ls Public -p "%d\t%s\t%TY/%Tm/%Td %TH:%TM:%TS\t%p\n"

Options
    -h print sizes in human readable format (e.g., 1K 234M 2G)
    -p print format.
        %d ... is_dir ( d: dir, -: file )
        %i ... id
        %n ... name
        %p ... path_display
        %P ... path_lower
        %b ... bytes
        %s ... size (e.g., 1K 234M 2G)
        %t ... server_modified
        %c ... client_modified
        %r ... rev
        %Tk ... DateTime 'strftime' function (server_modified)
        %Ck ... DateTime 'strftime' function (client_modified)
```

[http://search.cpan.org/dist/DateTime/lib/DateTime.pm#strftime\_Patterns](http://search.cpan.org/dist/DateTime/lib/DateTime.pm#strftime_Patterns)

## ls

file list view.

- alias

    list

- syntax

    dropbox-api ls &lt;dropbox\_path>

### Example

```
> dropbox-api list /product
d        - Thu, 24 Feb 2011 06:58:00 +0000 /product/chrome-extentions
-   294557 Sun, 26 Dec 2010 21:55:59 +0000 /product/ex.zip
```



( run in 0.463 second using v1.01-cache-2.11-cpan-71847e10f99 )