aboutsummaryrefslogtreecommitdiff
path: root/run/irc
diff options
context:
space:
mode:
Diffstat (limited to 'run/irc')
-rw-r--r--run/irc21
1 files changed, 21 insertions, 0 deletions
diff --git a/run/irc b/run/irc
new file mode 100644
index 0000000..c69af13
--- /dev/null
+++ b/run/irc
@@ -0,0 +1,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 $a = 'https://netsplit.de/channels/details.php?room=%23perl&net=freenode';
+my $r = $ua->get($a);
+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="$a"><img border="0" src="https://netsplit.de$1" alt="$2"/></a>
+HTML
+}