diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
commit | 03929dac2a29664878d2c971648a4fe1fb698462 (patch) | |
tree | 02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/kernel.pl | |
parent | Initial commit. (diff) | |
download | irssi-scripts-74dedaab1f75de511e9ded8f64dcf9a4c7d2946f.tar.xz irssi-scripts-74dedaab1f75de511e9ded8f64dcf9a4c7d2946f.zip |
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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'); |