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

WebPaste: remove ptpb.pw

This commit is contained in:
Pragmatic Software 2019-06-22 18:48:06 -07:00
parent ee33d9f5d6
commit 0f81e39276

View File

@ -35,7 +35,6 @@ sub initialize {
$self->{paste_sites} = [
sub { $self->paste_ixio(@_) },
sub { $self->paste_ptpb(@_) },
];
$self->{current_site} = 0;
@ -95,28 +94,4 @@ sub paste_ixio {
return $result;
}
sub paste_ptpb {
my $self = shift;
my $text = join(' ', @_);
$text =~ s/(.{120})\s/$1\n/g;
my $ua = LWP::UserAgent->new();
$ua->agent("Mozilla/5.0");
$ua->requests_redirectable([ ]);
$ua->timeout(10);
my %post = ( 'c' => $text, 'submit' => 'Submit' );
my $response = $ua->post("https://ptpb.pw/?u=1", \%post);
if (not $response->is_success) {
return "error pasting: " . $response->status_line;
}
my $result = $response->content;
$result =~ s/^\s+//;
$result =~ s/\s+$//;
return $result;
}
1;