aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-05-07 01:14:08 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-05-07 01:14:08 +0200
commitc587686e9a8ced8621b48fa4848586cd56578f55 (patch)
tree61d3c6dfcc6ffc0d09e2f75a0e7a226be93d5888
parent0d66f87241fd136c1d5236eed62c5dad1d6e0bba (diff)
downloadperlisdead-c587686e9a8ced8621b48fa4848586cd56578f55.tar.gz
Add default src/alt to irc image
-rwxr-xr-xrun/irc12
1 files changed, 7 insertions, 5 deletions
diff --git a/run/irc b/run/irc
index a77d8b2..2507809 100755
--- a/run/irc
+++ b/run/irc
@@ -12,10 +12,12 @@ $ua->agent('');
my $u = 'https://netsplit.de/channels/details.php?room=%23perl&net=freenode';
my $r = $ua->get($u);
-die $r->status_line if not $r->is_success;
-if ($r->decoded_content =~ m{<img border="0" src="(/tmp/channels/.*?\.png)" alt="(.*?)"}) {
- print <<HTML;
-<a href="$u"><img border="0" src="https://netsplit.de$1" alt="$2"/></a>
+my $i = '/tmp/channels/irc-stats-712-40793320.png';
+my $d = '#perl freenode - Graph about the amount of users during the last weeks';
+$r->decoded_content =~ m{<img border="0" src="(/tmp/channels/[^"<>]*?\.png)" alt="([^"<>]*?)"} if $r->is_success;
+$i = $1 if $1;
+$d = $2 if $2;
+print <<HTML;
+<a href="$u"><img border="0" src="https://netsplit.de$i" alt="$d"/></a>
HTML
-}