Created
April 15, 2009 02:24
-
-
Save mattn/95561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Config::Pit; | |
use WWW::Mechanize; | |
my $file = shift or die("usage: $0 [file]"); | |
my $config = pit_get( | |
"dropbox", | |
require => { | |
"email" => "your email on dropbox", | |
"password" => "your password on dropbox", | |
} | |
); | |
my $mech = WWW::Mechanize->new(); | |
$mech->get('https://www.getdropbox.com/'); | |
$mech->submit_form( | |
form_number => 2, | |
fields => $config | |
); | |
$mech->get('https://www.getdropbox.com/upload/?basic=1'); | |
$mech->submit_form( | |
form_number => 2, | |
fields => { file => $file } | |
); | |
print $mech->success() ? "succeseded to upload" : "failed to upload"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment