version 1.2, 2005/03/24 00:42:07 |
version 1.4, 2005/03/24 20:59:07 |
|
|
|
|
%ENV = (); |
%ENV = (); |
|
|
|
|
use YAML; |
use YAML; |
|
|
my $url_torrents = 'http://openbsd.somedomain.net/dumptorrents.php'; |
my $url_torrents = 'http://openbsd.somedomain.net/dumptorrents.php'; |
my $url_upload = 'http://openbsd.somedomain.net/newtorrents.php'; |
my $url_upload = 'http://openbsd.somedomain.net/newtorrents.php'; |
my $url_delete = 'http://openbsd.somedomain.net/deltorrents.php'; |
my $url_delete = 'http://openbsd.somedomain.net/deltorrents.php'; |
|
my $url_sanity = 'http://openbsd.somedomain.net/sanity.php'; |
|
|
my $user = 'torrentup'; |
my $user = 'torrentup'; |
my $pass = 'ssapword'; |
my $pass = 'ssapword'; |
|
|
|
my @Sizes = ('', 'Ki', 'Mi', 'Gi', 'Ti'); |
my $ua = LWP::UserAgent->new; |
my $ua = LWP::UserAgent->new; |
|
|
my $response = $ua->get($url_torrents); |
my $response = $ua->get($url_torrents); |
|
|
} |
} |
} |
} |
|
|
|
$ua->get($url_sanity); |
|
|
sub Upload_Torrent |
sub Upload_Torrent |
{ |
{ |
|
|
return undef; |
return undef; |
} |
} |
|
|
|
my $size = $t->total_size; |
|
|
|
my $i; |
|
while ($size > 1024) { |
|
$size /= 1024; |
|
$i++; |
|
} |
|
$size = sprintf('%.2f', $size); |
|
$size .= $Sizes[$i] . 'B'; |
|
|
my $comment = $t->{comment}; |
my $comment = $t->{comment}; |
$comment =~ s/\n.*$//s; |
$comment =~ s/\n.*$//s; |
|
|
my ($filename) = $comment =~ /Files from ([^<]+)/; |
my ($filename) = $comment =~ /Files from (.+)/; |
$filename =~ s#/# #g; |
$filename =~ s#/# #g; |
|
|
$filename .= ' (' . $time . ')'; |
$comment .= " [$size]"; |
|
$filename .= " [$time]"; |
|
|
my $response = $ua->post($url_upload, { |
my $response = $ua->post($url_upload, { |
username => $user, |
username => $user, |