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:
parent
028737f34d
commit
e30943ff70
@ -56,10 +56,16 @@ sub get_paste_site {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub paste {
|
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 = encode('UTF-8', $text);
|
||||||
$text =~ s/(.{120})\s/$1\n/g;
|
|
||||||
|
|
||||||
my $result;
|
my $result;
|
||||||
for (my $tries = 5; $tries > 0; $tries--) {
|
for (my $tries = 5; $tries > 0; $tries--) {
|
||||||
@ -75,10 +81,7 @@ sub paste {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub paste_ixio {
|
sub paste_ixio {
|
||||||
my $self = shift;
|
my ($self, $text) = @_;
|
||||||
my $text = join(' ', @_);
|
|
||||||
|
|
||||||
$text =~ s/(.{120})\s/$1\n/g;
|
|
||||||
|
|
||||||
my $ua = LWP::UserAgent->new();
|
my $ua = LWP::UserAgent->new();
|
||||||
$ua->agent("Mozilla/5.0");
|
$ua->agent("Mozilla/5.0");
|
||||||
|
Loading…
Reference in New Issue
Block a user