3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

WebPaste now can take option to disable word-wrapping

This commit is contained in:
Pragmatic Software 2019-08-06 18:23:13 -07:00
parent 028737f34d
commit e30943ff70

View File

@ -56,10 +56,16 @@ sub get_paste_site {
}
sub paste {
my ($self, $text) = @_;
my ($self, $text, %opts) = @_;
my %default_opts = (
no_split => 0,
);
%opts = (%default_opts, %opts);
$text =~ s/(.{120})\s/$1\n/g unless $opts{no_split};
$text = encode('UTF-8', $text);
$text =~ s/(.{120})\s/$1\n/g;
my $result;
for (my $tries = 5; $tries > 0; $tries--) {
@ -75,10 +81,7 @@ sub paste {
}
sub paste_ixio {
my $self = shift;
my $text = join(' ', @_);
$text =~ s/(.{120})\s/$1\n/g;
my ($self, $text) = @_;
my $ua = LWP::UserAgent->new();
$ua->agent("Mozilla/5.0");