Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Irssi;
- use strict;
- use vars qw($VERSION %IRSSI);
- $VERSION = "1.00";
- %IRSSI = (
- authors => 'igogiko',
- name => 'lastfmnp',
- description => 'Displays current last.fm np for nick.',
- license => 'tapan sut',
- changed => 'EI VITTU IKINA' );
- sub lastfm {
- my ($nick, $server, $chan) = @_;
- my $yournick = "igogiko-YUP";
- if(!$server || !$server->{connected}) {
- Irssi::print("Not connected to server");
- return;
- }
- my $output = `python ~/.irssi/scripts/lastfm.py $yournick`;
- $output =~ s/\s+$//;
- if($chan && ($chan->{type} eq "CHANNEL" ||
- $chan->{type} eq "QUERY")) {
- $server->command("MSG ".$chan->{name}." np: $output");
- }
- }
- Irssi::command_bind ('np', 'lastfm');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement