mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-25 19:44:26 +01:00
Add arin.ga to WebPastes
This commit is contained in:
parent
e78d64b623
commit
26180b2ebb
@ -38,6 +38,7 @@ sub initialize {
|
|||||||
sub { $self->paste_ixio(@_) },
|
sub { $self->paste_ixio(@_) },
|
||||||
sub { $self->paste_ptpb(@_) },
|
sub { $self->paste_ptpb(@_) },
|
||||||
sub { $self->paste_gehidore(@_) },
|
sub { $self->paste_gehidore(@_) },
|
||||||
|
sub { $self->paste_aringa(@_) },
|
||||||
];
|
];
|
||||||
|
|
||||||
$self->{current_site} = 0;
|
$self->{current_site} = 0;
|
||||||
@ -190,4 +191,29 @@ sub paste_gehidore {
|
|||||||
return $result;
|
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;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user