3
0
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:
Pragmatic Software 2025-10-21 12:37:24 -07:00
parent c60888088e
commit 828412e931
No known key found for this signature in database
GPG Key ID: CC916B6E3C84ECCE
2 changed files with 16 additions and 10 deletions

24
applets/insult.pl vendored
View File

@ -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";

View File

@ -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",
};