mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 04:19:27 +01:00
WebPaste: remove ptpb.pw
This commit is contained in:
parent
ee33d9f5d6
commit
0f81e39276
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user