Upload cpanfile

You can upload any cpanfile. Please not that you can only upload cpanfiles up to a size of 10 KB. And you can only do 1 request per 5 seconds. These limits are used to avoid heavy loads caused by bots.

cpanfile*:

If you do not want to use this upload form, you can use something like


#!/usr/bin/perl
  
use strict;
use warnings;

use Data::Printer;
use Mojo::File qw(path);
use Mojo::UserAgent;

my $content = path( $ARGV[0] || 'cpanfile' )->slurp;
my $ua      = Mojo::UserAgent->new;

my $tx = $ua->post(
    'http://localhost:3000/upload',
    form => {
        cpanfile => {
             filename => 'cpanfile',
             content  => $content,
        }
    }
);

p $tx->res;
          
or with HTTP::Tiny:

#!/usr/bin/perl
  
use strict;
use warnings;

use Data::Printer;
use File::Slurp;
use HTTP::Tiny;
use HTTP::Tiny::Multipart;

my $content = read_file( $ARGV[0] || 'cpanfile' );
my $ua      = HTTP::Tiny->new;

my $res = $ua->post_multipart(
    'http://localhost:3000/upload',
    {
        cpanfile => {
             filename => 'cpanfile',
             content  => $content,
        }
    }
);

p $res;
          
Just change the path to the cpanfile and the URL.