aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-}