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

use strict;
use warnings;

use LWP::UserAgent ();

my $ua = LWP::UserAgent->new(timeout => 5);
$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);
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>
HTML
}