All pastes #230131 Raw Edit

Miscellany

public text v1 · immutable
#230131 ·published 2006-10-31 03:34 UTC
rendered paste body
#!/usr/bin/perl -w
#Coded by Rick Bargerhuff alias cougar
#Created : 2004/9/21
#Modified : 2004/9/22
#Description : Simple iTunes announcement script via action

#Debuggin purposes only
my $track_info = `/usr/bin/osascript -e 'tell application "iTunes" to return artist of current track & " - " & name of current track & " @" & bit rate of current track & " kbps" as string'`;
   
print "Listening to $track_info";

sub itunes
{
   #Edit as you like but keep in mind and follow syntax
   my $track_info = `/usr/bin/osascript -e 'tell application "iTunes" to return name of current track & " by " & artist of current track & " from the " & album of current track & " album " as string'`;
     
   chomp($track_info);
   
   #Edit as you like but do not remove $track_info
   IRC::command ("/me is listening to $track_info" );
   
   return 1;
}

IRC::register ("itunes", "1.0", "", "");

IRC::add_command_handler ("itunes", "itunes");