1# Fetches the version(s) of the latest Linux kernel(s).
2
3# /kernel
4
5use strict;
6use Irssi;
7use LWP::Simple;
8
9use vars qw($VERSION %IRSSI);
10
11$VERSION = '0.10';
12%IRSSI = (
13    authors     => 'Johan "Ion" Kiviniemi',
14    contact     => 'ion at hassers.org',
15    name        => 'Kernel',
16    description => 'Fetches the version(s) of the latest Linux kernel(s).',
17    license     => 'Public Domain',
18    url         => 'http://scripts.irssi.org/',
19    changed     => '2018-03-11',
20);
21
22sub wget {
23	my $con =get("https://www.kernel.org/finger_banner");
24	return $con;
25}
26
27sub get_version {
28    my @version;
29    if (my $finger = wget()) {
30        # The magic of the regexps :)
31        @version = $finger =~ /:\s*(\S+)\s*$/gm;
32        # Modify this to do whatever you want.
33        Irssi::print("@version");
34    }
35}
36
37Irssi::command_bind('kernel_version', 'get_version');
38