Newbie ? Mot de passe ?
h1

Song Displayer : a WordPress plugin to display on your blog what Winamp or SAM Broadcaster is playing

le Mercredi 10 mai 2006 à 00:27 par Matt

Song Displayer is a WordPress plugin that displays what is playing in Winamp or SAM Broadcaster on your blog.

How it works

The plugin consists of 4 files :

  • MP3-in.php is a template for Winamp, used to generate the playlist.
  • MP3-in-sam.php is a template for SAM Broadcaster, used to generate the playlist.
  • MP3-out.php is the generated playlist with ID3-tags. This file will be uploaded on your server every time a song plays.
  • song_displayer.php is the WordPress plugin to be placed into your /wp-contents/plugins/ directory.

The plugin reads the generated playlist and extracts the information to display the data contained in the ID3v1 tags. If the tags are incomplete or missing, the plugin displays the name of the files. By default, the artist name and song title is displayed, along with the album title if available. If the playlist hasn’t been regenerated in the laps of time you define, the plugin assumes your webradio is off and displays a ‘Radio is off’ message. Otherwise, it displays the song info on your blog and you can link it to your Shoutcast or Icecast stream.

Download

http://www.skyminds.net/?download=song_displayer

Install guide for Winamp

First, you need the DoSomething plugin for Winamp.
Once installed, go to Winamp > Préférences > Plugins > General Purpose > DoSomething and select Configure. Activate the plugin by unticking the Disable Plugin box.

Playlist creation

In the drop-down menu, select Generate HTML Playlist. In Template In, enter the path of MP3-in.php that resides on your hard-drive. Do the same for Template Out with MP3-out.php. Click Update to save the changes.

Generate Playlist

Upload the playlist on your server via FTP

Once the playlist generated, you nedd to upload it on your server. Select the FTP service in the drop-down menu and fill in the fields with your FTP account info :

FTP Playlist

That’s it. Now on to the plugin configuration.

Install guide for SAM Broadcaster

Setting up the playlist generation in SAM is pretty straight-forward :

  • place MP3-in-sam.php and MP3-out.php in your /Program Files/SpacialAudio/SAMBC/samHTMweb/ directory.
  • go to File > Config > HTML Output and add a new rule for playlist generation, using MP3-in-sam.php as input file and MP3-out.php as output file.
  • tick Auto-upload generated file via FTP and configure your FTP access.
  • done !

Here is a screenshot of the configuration on SAM :

sam song displayer

Plugin configuration

Upload the plugin

You now need to upload song_displayer.php in your /wp-contents/plugins/ directory. Chmod it 666 with your FTP client (right-click on the file > Chmod/permissions > 666) to be able to edit it via WordPress plugin editor.

The plugin has got 3 options : the URL of the playlist (MP3-out.php) from the index page of your blog, the delay in seconds before assuming Winamp is turned off (7 minutes by default, edit this value according to the average length of your songs) and the URL of your webradio stream if you have one.

Data integration on your blog

This is the last step : add the following code to your sidebar.php template where you want the information to appear :

<?php if(function_exists('show_playlist')) { show_playlist(1, " - ", ""); } ?>

Function parameters

  1. First parameter : number of lines to display. Default is 1 : current song.
  2. Second parameter : separator between artist and song names.
  3. Third parameter : separator used for multiple lines. Default is blank, otherwise put a linebreak.

That’s it ! You should now be set and have what’s playing in Winamp or SAM Broadcaster displayed on your blog.


13 commentaires à “Song Displayer : a WordPress plugin to display on your blog what Winamp or SAM Broadcaster is playing”

  1. Hazel a écrit :
    1

    THANKS ! I appreciate your help very much :)

  2. Matt a écrit :
    2

    My pleasure Hazel :)

  3. golddave a écrit :
    3

    I’ve been playing with this plugin all day. It always says “Radio is off !”. I have $playlist and file permissions set correctly. I started playing with the code and have not been able to get it to work at all. No matter what I do I cannot get it to display any data.

  4. Matt a écrit :
    4

    Hello golddave,

    Is the playlist uploaded correctly ? If you access it in your browser, does it reflect what you’re playing ? What is your value in $playlist ?

  5. golddave a écrit :
    5

    I got it to work. Everything was working fine but the path I put in for $playlist didn’t account for the fact that I’m on a shared host. I had /public_html/mp3-out.php but since I’m on a shared host I really needed /home/golddave/public_html/mp3-out.php. Once I made that change it worked fine.

  6. Matt a écrit :
    6

    I’m glad you’re sorted golddave :)

  7. carpenter a écrit :
    7

    Hi, it took me 15 minutes, but it works fine ! But the “DoSomething plugin for Winamp” is what makes me troubles. Since its installation Winamp crashes everytime I try to play some net-radio. Anybody knows what to do ??

  8. Matt a écrit :
    8

    Hi carpenter,

    You need to disable the plugin when playing net-radios as it’s intended for local music only.

    Hope that helps,

  9. carpenter a écrit :
    9

    Hi, I would like to show more than only the last song on my page. Is there a way how to set it up ?

  10. Matt a écrit :
    10

    Hello carpenter,

    To display the last 5 recently played songs, put :

    <?php show_playlist(5, " - ", "< br />"); ?>
  11. Jon a écrit :
    11

    Hi, I’ve been having a similar problem to what other have had : The DoSomething plugin works fine and the MP3-out.php uploads correctly, but for some reason the song_displayer.php file can’t pull it up. It just says the radio is off. I’ve tried setting the delay lower and it doesn’t work. The location of the MP3-out file is also correct — /home/.ellis/username/folder/mp3-out.php. The plugin used to work perfectly, but now for some reason it has stopped (I didn’t make any changes to the files).

  12. Matt a écrit :
    12

    Hello Jon,

    Can you give me the MP3-out.php and the plugin URL via email ? Thanks.

  13. Matt a écrit :
    13

    Updated tutorial with SAM Broadcaster configuration.

2 trackbacks

  1. Song Displayer : plugin WordPress pour afficher ce que joue Winamp .::::::. le blog de SkyMinds
  2. Song Displayer Rewrite? « A Whole Lot of Nothing
Go to: Article | Commenter!

Laisser un commentaire

Quicktags: THINK. Then write. No SMS.