version 1.4, 2005/03/24 20:59:07 |
version 1.8, 2005/04/01 01:20:15 |
|
|
|
|
%ENV = (); |
%ENV = (); |
|
|
|
#use YAML; |
|
|
use YAML; |
justme(); |
|
|
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 %files; |
my %files; |
opendir DIR, $TorrentDir or die "Couldn't opendir $TorrentDir: $!"; |
opendir DIR, $TorrentDir or die "Couldn't opendir $TorrentDir: $!"; |
foreach (readdir DIR) { |
foreach (readdir DIR) { |
|
chomp; |
if (/^([^\/]+)$/) { |
if (/^([^\/]+)$/) { |
$_ = $1; |
$_ = $1; |
} else { |
} else { |
die "Invalid character in $_: $!"; |
die "Invalid character in $_: $!"; |
} |
} |
next unless /\.torrent$/; |
next unless /\.torrent$/; |
chomp; |
|
my ($name, $year, $mon, $mday, $hour, $min) = |
my ($name, $year, $mon, $mday, $hour, $min) = |
/^(.*)-(\d{4})-(\d{2})-(\d{2})-(\d{2})(\d{2})/; |
/^(.*)-(\d{4})-(\d{2})-(\d{2})-(\d{2})(\d{2})/; |
|
|
|
$mon--; |
|
|
my $epoch = timegm(0,$min,$hour,$mday,$mon,$year); |
my $epoch = timegm(0,$min,$hour,$mday,$mon,$year); |
|
|
$files{$name}{$epoch} = { |
$files{$name}{$epoch} = { |
|
|
}, Content_Type => 'form-data'); |
}, Content_Type => 'form-data'); |
|
|
if ($response->is_success) { |
if ($response->is_success) { |
print "Uploaded $file\n"; |
print STDERR "Uploaded $file\n"; |
#print $response->content; |
#print $response->content; |
} else { |
} else { |
die $response->status_line; |
die $response->status_line; |