From 828412e93163570fe53c40466a67c62fcbcecb9c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 21 Oct 2025 12:37:24 -0700 Subject: [PATCH] applets/insult.pl: website defunct; use scraped insults instead --- applets/insult.pl | 24 +++++++++++++++--------- lib/PBot/VERSION.pm | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/applets/insult.pl b/applets/insult.pl index da303fd4..a9bf3de6 100755 --- a/applets/insult.pl +++ b/applets/insult.pl @@ -1,15 +1,21 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -# SPDX-FileCopyrightText: 2009-2023 Pragmatic Software +# SPDX-FileCopyrightText: 2009-2025 Pragmatic Software # SPDX-License-Identifier: MIT use strict; -use LWP::Simple; +use warnings; -$_ = get("http://www.randominsults.net/"); -if (/(.*?)\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"; diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 72124671..1b66728f 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -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", };