cacert-webdb/cacertupload.pl

36 lines
863 B
Perl
Raw Normal View History

2007-08-21 16:33:14 +00:00
#!/usr/bin/perl
use LWP::UserAgent;
$ua = LWP::UserAgent->new(agent => 'Translingo Client 1.0');
use HTTP::Request::Common qw(POST);
$ua->cookie_jar({});
my $req = POST 'http://www.translingo.org/login.php',
[
];
# ggf. Referer faken
$req->referer('http://www.translingo.org/');
$ua->request($req)->as_string;
# 1.Test - Umgebung
my $req = POST 'http://www.translingo.org/login.php',
[
username => 'support@cacert.org',
password => 'ilccSSAMNIemU',
submit => 'Login',
];
# ggf. Referer faken
$req->referer('http://www.translingo.org/');
$ua->request($req)->as_string;
# 2.Test - FileUpload
my $req = POST 'http://www.translingo.org/upload.php',
Content_Type => 'form-data',
Content => [
project => '1',
fileformat => '1',
pofile => ["messages.po" => "messages.po", 'Content_Type' => "application/x-gettext"],
];
print $ua->request($req)->as_string;