aboutsummaryrefslogtreecommitdiff
path: root/run/irc
blob: 89ae4fad3305f54d9cc0aa6472b893e2ae0b6477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

use strict;
use warnings;

use LWP::UserAgent ();

my $ua = LWP::UserAgent->new(timeout => 10);
$ua->ssl_opts(verify_hostname => 0);
$ua->env_proxy;
$ua->agent('');

my $u = 'https://netsplit.de/channels/details.php?room=%23perl&net=freenode';
my $r = $ua->get($u);

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