Post Reply 
[XChat] Now Playing for Songbird
Author Message
Joom
WOOP
Worlds End

Posts: 4,206.7320
Threads: 417
Joined: 20th Mar 2009
Reputation: 5.41709
E-Pigs: 134.1772
Offline
Post: #1
[XChat] Now Playing for Songbird
This is a script that I found in a Pastebin and updated just a tad to work with the newer Songbird. If you're a Windows user, you need the newest version of Active Perl.

How to Use

-Install the Livetweeter addon for Songbird.
-Go to Tools - Addons - Livetweeter - Options.
-Enable the text file support (and anything else you want).
-Create a new blank text document named "song.txt" in either of these.
      Windows: %Program Files%\Songbird\
      Linux: ~/.songbird2/
-Create a new Perl script (just make a new text document and change the extension to .PL) and place it in XChat's plugins folder.
-Paste this code in it and save it.

Windows Users: You must have the newest version of Active Perl to use this script.

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Songbird Nowplaying Script for xChat IRC client. This script only works on Linux and Windows. You may edit it for Mac OS X.
#
#This requires the XChat IRC client to be installed (www.xchat.org/) and the Songbird (http://www.getsongbird.com/) media player.
#Once you have both installed, install the Live Tweeter addon for Songbird.
#In Songbird, click tools, addons, Live Tweeter, then options. Click the Messenger tab at the top and enable the text file.
#Create an empty text document and place it wherever you wish. 
#This script may need to be changed depending on where you place the text file (change either line 31 or 33).
#Run xChat and load this script. To display what Songbird is playing, type /sb and press enter. 
#"Songbird is now playing: "artist" - "song" " will be displayed. If you'd like to change this, edit the info in the parantheses on line 45.
#If you would like it to display your name using the /me command, replace "say" on line 45 with "me" (without quotes).
#You can type /sbhelp in xChat to get help with commands.

my $song_file = '';

use strict;
use warnings;
use File::Glob ();
use Xchat qw(:all);

register( "Songbird Announcer",
    "0.2", "Announces the current playing song information from Songbird" );

prnt( "Use \cB/sb\cB or \cB/songbird\cB to announce current song" );
prnt( "\cB/sbhelp\cB shows help" );

hook_command( "sb",       \&songbird );
hook_command( "songbird", \&songbird );
hook_command( "sbhelp",   \&sbhelp );

if( $^O eq 'MSWin32' ) {
    $song_file ||= 'C:\Program Files\Songbird\song.txt';
} else {
    $song_file ||= glob( '~/.songbird2/song.txt' );

    if( $song_file =~ /^~/ ) {
        $song_file = bsd_glob( $song_file );
    }
}

sub songbird {
    if ( open my $song_fh, "<", $song_file ) {
        chomp( my $song = <$song_fh> );
        close $song_fh;

        command( "say «Now playing in Songbird» " . $song );
    } else {
        prnt "Unable to open song file '$song_file': $!";
    }
}

sub sbhelp {
    prnt( "::::::::::::::::: \cBCommands\cB :::::::::::::::::::::::::" );
    prnt( "##\cB /sb\cB or\cB /songbird\cB announce current song         ##" );
    prnt( "##\cB /sb\cB or\cB /songbird\cB                               ##"
    );
    prnt( "##\cB /sbhelp\cB to show help                           ##" );
}


-To display what you are playing, just type "/sb" in XChat.

Credits go to the original author of this script.

(This post was last modified: 24/07/2010 11:34 AM by Joom.)
18/07/2010 09:38 PM
Find all posts by this user Quote this message in a reply
YoYoBallz
L4YoY0s

Posts: 6,057.4567
Threads: 644
Joined: 3rd Mar 2007
Reputation: 15.01961
E-Pigs: 13327.7533
Offline
Post: #2
RE: [XChat] Now Playing for Songbird
w00th00t nicenice joomla

[00:26] <Grey_Ghost> so i can't use chatzilla?

- For this script, no.  Try google for chatzilla ones.

<Myth0s> i love boys
-------------------------------------------------------------------
I Go To Earth When Mars Is Boring.
-------------------------------------------------------------------
¿ʞɔпɟ əɥʇ ʇɐɥʍ I was first EPerson to have upside down title.
-------------------------------------------------------------------
19/07/2010 07:12 AM
Find all posts by this user Quote this message in a reply
S7*
Sweet Dreams

Posts: 16,689.4373
Threads: 1,056
Joined: 3rd Apr 2007
Reputation: 14.29926
E-Pigs: 383.2289
Offline
Post: #3
RE: [XChat] Now Playing for Songbird
Songbird?

I was just getting into foobar2000 v.v
19/07/2010 08:06 AM
Find all posts by this user Quote this message in a reply
Joom
WOOP
Worlds End

Posts: 4,206.7320
Threads: 417
Joined: 20th Mar 2009
Reputation: 5.41709
E-Pigs: 134.1772
Offline
Post: #4
RE: [XChat] Now Playing for Songbird
I've been using Songbird a lot lately. used VLC for a while and that got annoying loading songs by hand.

(19/07/2010 12:49 AM)MysterySword Wrote:  Slightly off-topic, but does SongBird group albums with multiple artists into a group like "Various Artists" yet? I liked Songbird, but I didn't like that it wouldn't group albums.

You can download an addon that does that for you. By default it uses a filter pane though.
19/07/2010 09:08 PM
Find all posts by this user Quote this message in a reply
Joom
WOOP
Worlds End

Posts: 4,206.7320
Threads: 417
Joined: 20th Mar 2009
Reputation: 5.41709
E-Pigs: 134.1772
Offline
Post: #5
RE: [XChat] Now Playing for Songbird
I use an addon called Spot Bird. You'll have to edit some settings to use it though since it's not supported on newer versions of SB.
19/07/2010 10:08 PM
Find all posts by this user Quote this message in a reply
Joom
WOOP
Worlds End

Posts: 4,206.7320
Threads: 417
Joined: 20th Mar 2009
Reputation: 5.41709
E-Pigs: 134.1772
Offline
Post: #6
RE: [XChat] Now Playing for Songbird
Hm, I may try that. Adding a new Boolean helped too.
19/07/2010 11:03 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread:

 Quick Theme: