Skip to content

Instantly share code, notes, and snippets.

@mattn
Created April 15, 2009 02:24
Show Gist options
  • Save mattn/95561 to your computer and use it in GitHub Desktop.
Save mattn/95561 to your computer and use it in GitHub Desktop.
#!/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