diff options
Diffstat (limited to 'scripts/kernel.pl')
-rw-r--r-- | scripts/kernel.pl | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/kernel.pl b/scripts/kernel.pl new file mode 100644 index 0000000..435a068 --- /dev/null +++ b/scripts/kernel.pl @@ -0,0 +1,37 @@ +# Fetches the version(s) of the latest Linux kernel(s). + +# /kernel + +use strict; +use Irssi; +use LWP::Simple; + +use vars qw($VERSION %IRSSI); + +$VERSION = '0.10'; +%IRSSI = ( + authors => 'Johan "Ion" Kiviniemi', + contact => 'ion at hassers.org', + name => 'Kernel', + description => 'Fetches the version(s) of the latest Linux kernel(s).', + license => 'Public Domain', + url => 'http://scripts.irssi.org/', + changed => '2018-03-11', +); + +sub wget { + my $con =get("https://www.kernel.org/finger_banner"); + return $con; +} + +sub get_version { + my @version; + if (my $finger = wget()) { + # The magic of the regexps :) + @version = $finger =~ /:\s*(\S+)\s*$/gm; + # Modify this to do whatever you want. + Irssi::print("@version"); + } +} + +Irssi::command_bind('kernel_version', 'get_version'); |