diff options
author | John Ankarström <john@ankarstrom.se> | 2021-05-07 01:14:08 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-05-07 01:14:08 +0200 |
commit | c587686e9a8ced8621b48fa4848586cd56578f55 (patch) | |
tree | 61d3c6dfcc6ffc0d09e2f75a0e7a226be93d5888 | |
parent | 0d66f87241fd136c1d5236eed62c5dad1d6e0bba (diff) | |
download | perlisdead-c587686e9a8ced8621b48fa4848586cd56578f55.tar.gz |
Add default src/alt to irc image
-rwxr-xr-x | run/irc | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 -} |