要Pecl::OAuth
% php /home/atyks/chalow/src/downloadDropbox/download_filh.php
|php|
<?php
ini_set(“include_path”, “/home/atyks/chalow/src/downloadDropbox” . PATH_SEPARATOR . ini_get(“include_path”) );
define(“CHANGE_LOG_PATH”, “/home/atyks/chalow/”);
/ Please supply your own consumer key and consumer secret/
$consumerKey = ‘hjwo1eahd8oskr9’;
$consumerSecret = ’53eyv7xlj9ht4oo’;
include ‘Dropbox/autoload.php’;
$oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);
// If the PHP OAuth extension is not available, you can try
// PEAR’s HTTP_OAUTH instead.
// $oauth = new Dropbox_OAuth_PEAR($consumerKey, $consumerSecret);
$dropbox = new Dropbox_API($oauth);
$tokens = $dropbox->getToken(‘your-mail-addrsss’, ‘xxxxxxxxxx’);
// Note that it’s wise to save these tokens for re-ush.
$oauth->setToken($tokens);
file_put_contents(CHANGE_LOG_PATH . “/changelog.txt”, $dropbox->getFile(‘changelog.txt’));
?>
||<