mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-22 02:57:27 +02:00
applets/insult.pl: website defunct; use scraped insults instead
This commit is contained in:
parent
c60888088e
commit
828412e931
24
applets/insult.pl
vendored
24
applets/insult.pl
vendored
@ -1,15 +1,21 @@
|
||||
#!/usr/bin/perl -w
|
||||
#!/usr/bin/perl
|
||||
|
||||
# SPDX-FileCopyrightText: 2009-2023 Pragmatic Software <pragma78@gmail.com>
|
||||
# SPDX-FileCopyrightText: 2009-2025 Pragmatic Software <pragma78@gmail.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
use strict;
|
||||
use LWP::Simple;
|
||||
use warnings;
|
||||
|
||||
$_ = get("http://www.randominsults.net/");
|
||||
if (/<strong><i>(.*?)\s*<\/i><\/strong>/) {
|
||||
print "@ARGV", ': ' if @ARGV;
|
||||
print "$1\n";
|
||||
} else {
|
||||
print "yo momma!";
|
||||
srand;
|
||||
|
||||
open my $fh, '<', 'insults.txt' or die $!;
|
||||
|
||||
my $line;
|
||||
|
||||
while (<$fh>) {
|
||||
$line = $_ if rand($.) < 1;
|
||||
}
|
||||
|
||||
chomp $line;
|
||||
print "@ARGV", ': ' if @ARGV;
|
||||
print "$line\n";
|
||||
|
@ -25,7 +25,7 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4913,
|
||||
BUILD_REVISION => 4914,
|
||||
BUILD_DATE => "2025-10-21",
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user