3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

Add arin.ga to WebPastes

This commit is contained in:
Pragmatic Software 2018-01-01 08:52:16 -08:00
parent e78d64b623
commit 26180b2ebb

View File

@ -38,6 +38,7 @@ sub initialize {
sub { $self->paste_ixio(@_) },
sub { $self->paste_ptpb(@_) },
sub { $self->paste_gehidore(@_) },
sub { $self->paste_aringa(@_) },
];
$self->{current_site} = 0;
@ -190,4 +191,29 @@ sub paste_gehidore {
return $result;
}
sub paste_aringa {
my $self = shift;
my $text = join(' ', @_);
$text =~ s/(.{120})\s/$1\n/g;
my $ua = LWP::UserAgent->new();
$ua->agent("Mozilla/5.0");
push @{ $ua->requests_redirectable }, 'POST';
$ua->timeout(10);
my %post = ( 'aringa' => $text, 'submit' => 'Submit' );
my $response = $ua->post("https://arin.ga", \%post);
if(not $response->is_success) {
return "error pasting: " . $response->status_line;
}
my $result = $response->request->uri;
$result =~ s/^\s+//;
$result =~ s/\s+$//;
$result .= '/raw';
return $result;
}
1;