Who We Are
bmk
girlie
kristine
Search



Notify List
Let us keep you posted on new entries! Join the notify list!
Blog Status
14 entries
146 comments
12.06.04 11:44 am last update
last 50 referrers

Listed on BlogShares
Syndication
link to us!

virtual venus

virtual venus: MT Wiki
Powered By
because weblogs need love too
Sunday, June 1, 2003
Winamp Hoverable Playlist

Displaying the songs you are listening to in real time, along with detail about them, is a nice addition to your site. Using a combination of plugins can give many options for the display of info. My goal was to not only make a list of the songs I was listening to, but to display an album cover from the song upon hovering.

With this in mind, I started with the concept and Trackback URL format from A Whole Lotta Nothing. The idea is to use Trackback to transfer the info rather than FTP or another method. Because most of my songs on my system have ID3 tags on them, I added some additional info to be pulled in with the Trackback.

I had seen Brad's concept for an advanced Macro that used the Overlib script to change

<amazon keyword="album title">
into an amazon link with a hover. The Trackback URL contains the Current Song title, the Current Album Name, and the Current Artist. This combined with the IfEmpty plugin to determine if the Current Album and Artist info is available will either give text or the code for a hover with the album title and link to purchase it at Amazon.

Finally, some PHP gives a different message if WinAmp is stopped is added and the whole thing is included onto my sidebar. The details of how I've done this are below. Many modifications could be made to this to make it work the way YOU want it to!




Required:


Example from kadyellebee.com
winamp2.gif
When you hover the title of the song, the overlib popup displays, giving the album picture and a purchase link.

Directions:

  • Create a new blog or select one of your less traveled blogs. This will keep the rebuilds upon trackback down.
    • Create a new category. Entries won't be posted in the category, but trackback pings will come into it. I named mine Incoming, because that's a term I use through my sites when data is pulled into a template.
    • Edit the category attributes. Turn on Accept Incoming TrackBack pings.
    • Click Save, and more info will appear below.
    • Note the TrackBack URL for this category:
      http://your-site.com/mt/mt-tb.cgi/3779

      This will be what you use in the next steps.
    • Open Winamp, and use the menu to select Options > Preference and then go to Plugins and click on the General Purpose option.
      • Select the DoSomething plugin and click Configure. If DoSomething is not in the list, it means you probably haven't installed it into the correct directory. Double check the DoSomething documentation.
      • I have the following check boxes checked:
        • Enable Error Messages
        • Show Status Window
      • Now we are gonna create a new action.
        • From the Action drop down box, select "Submit A URL"
        • In the URL box, you'll put something like this (all on one line - breaks are only added for wrapping):
          http://your-site.com/mt/mt-tb.cgi?tb_id=3779
          &excerpt=%%CURRENTSONG%%&url=blank&
          blog_name=%%URL_CURRENTALBUM%%
          %20%%URL_CURRENTARTIST%%

          The italicized portion should be filed in with your Trackback URL you noted from before.
        • The URL Result File box can stay empty.
        • Click "Add -->" button on the right side.
        • Fill in a directory loction in the Temp Dir box. I use my music folder on my computer just to keep things all in one place.
        • Click the "OK" button.

        click to view the config screen
    • Now Winamp and DoSomething are set to send the info to MT. We'll set up a template to display the info.
      • Create a New Index Template named Incoming with an output file of incoming.php.
      • Paste the below code into the template:
      • I created a new Module named regex to store the amazon definition. Paste the following into it:
  • I use PHP to include this file into my Main Index template on my main blog. This will keep the list current without having to rebuild your index page itself.
    An example of a PHP include statement is as follows:
    <?
    include("/home/USER/public_html/BLOG/incoming.php");
    ?>
  • You'll also want to follow the Overlib instructions to put the script into your Main Index template on your main blog.
    this would include uploading the .js file and adding two lines of code to your template - the first in the <head> container, and the second inside the <body> :
    <script language="JavaScript" src="http://your-site.com/overlib.js"></script>

    <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;">&nbsp;</div>
That should do it! You now have a fully functioning playlist that connects your music player to your website.



Update! June 7, 2003

For websites with a goal of having XHTML valid code, the regex module from above can be replaced with this:

And then in the head of your document where you insert the javascript for overlib, paste this:

This will put all of the < and > tags into the variables in the head rather than in the body of the page where it may not validate.

Update! August 9, 2003

I updated a few syntax errors - the incoming template was missing a question mark to close the PHP script, and I took out some spaces in the updated javascript var statements; I'm not sure if it matters, but I cleaned it up in case. :)


Comments: 36

Question: do i need any special php headers on any of these sites to have a php include? I used to use b2 and that was all php, but we had headers & footers, and now I use MT which has static .html pages. Any help on this?

by Kristina at 11:58 AM on 06.01.03

Kristina - to use php include statements, you'll need to at least have your index page with a .php extension... For more info on converting, check out the MT Wiki: Converting To PHP. :)

by kristine at 06:31 PM on 06.01.03

yay! thank you so much for this, kristine! :)

by reb at 12:34 PM on 06.03.03

Thank You!
I am trying to mod it a little and I can't get the regex module to work properly with MTBlogPings! It doesn't understand anyting in the tags.

by Doc at 04:50 PM on 06.03.03

Doc: So is it not processing the <amazon> container at all? It seems like the BlogPings plugin *should* work in there. If I have extra time this week, I'll try to test some of that out.

by kristine at 02:44 PM on 06.04.03

MTBlogPings is working, but its not processing the tag. It does process the first part just fine. If I remove the amazon tag, it works just fine, without the links.
I talked to rayners about it and hes looking at it some more as well.

by Doc at 08:44 AM on 06.05.03

What happens if I don't have PHP installed? Can I still enable a Winamp playlist to be displayed within my newbie blog? :)

Andrew

by Andrew Wong at 08:10 PM on 06.06.03

Andrew - PHP is definately recommended for this tutorial because it will keep your rebuilds to a minimum. Using a MTInclude would require you to rebuild after every song, and that kind defeats the purpose of it being real-time!
But maybe one of the other girls has an idea of how to do something without it. :)

by kristine at 12:16 AM on 06.07.03

Ever since I first visited your site I LOVED THIS! I always wanted to know how it was done and now I do! Thanks! I've been having trouble getting it going on my site though. :( I have everything installed and walked step by step through it and I still can't get it to go. :( My info on the side shows the "updated 06/08/03..." but none of the songs, etc. I have the winamp plugin going and it says "submitting url" but still nothing appears on the page (on the side under listening to) Any ideas would be helpful! Thanks Kristine! :)

by Casey at 04:37 PM on 06.08.03

Small problem. If for some reason it can get a result from Amazon, it put a big nothing in the file. I end up with the starting DIV tag, and the ending /DIV tag, with nothing in between. I found out after a song that was playing had the wrong album information, and noticed the list had a visible gap in it.

What do I need to change to make it so that if it gets no results, to just insert the Excerpt, without any links to anything?

by AMK4 at 01:17 PM on 06.09.03

I have the same problem AMK4

by Doc at 07:22 PM on 06.09.03

Casey -- Do you see that the trackback pings are actually getting submitted inside of MT? If nothing is showing, I would wonder if that's the problem...

AMK -- the IfEmpty plugin is what controls that, so as long as you have info for the song title, it should work... (Its the CURRENTSONG tag for dosomething that is publishing to the excerpt: &excerpt=%%CURRENTSONG%%) Maybe make sure that the IfEmpty plugin is working correctly with something similar.

If either of you have test pages that you'd like me to look at, I'm happy to check them out as time allows :)

by kristine at 07:07 PM on 06.17.03

Kristine, the problem on mine seems to stem from blog_name=%%URL_CURRENTALBUM%%
%20%%URL_CURRENTARTIST%% .

I get the empty DIV tags when Only one of the two variables exists. ie I have some MP3s that don't have all the info filled, so if CURRENTALBUM is empty but URL_CURRENTARTIST isn't, MTIFEmpty doesn't know how to handle it so It outputs nothing, which of course, leaves an empty DIV in my case.

When both Variables are missing from the string MTIfEmpty works properly. I looked for a better way to tell it to do what MTIfEmpty does, but I haven't found one yet. I tried an MTElse to cover any other variables undefined, but it doesn't work inside an MTPings Tag, of course.

If you want, e-mail me and I will send you my template and maybe you can figure a better workaround.

by Doc at 07:44 PM on 06.18.03

Good point Doc. I get the same response on my end. I got it to work Kristine - thanks for your help! A few of my tracks off of Winamp (likewise) don't have some of the tags and it leaves

tags empty and spaces, etc. Any ideas yet?

by Casey at 08:25 AM on 06.19.03

Hey, Kristine. I'm using this on my site here but it doesn't seem like WinAmp is sending the pings to my blog. I have all the files, plug ins, etc. Any ideas?

Thanks,
Alexis

by Alexis at 10:09 PM on 06.30.03

I use a feature like this on my site, it is great

by Tibu at 03:36 PM on 07.04.03

Okay, I'm having a small problem with this particular addon.

Basically, the pings go through, the incoming.php gets written, but it doesn't seem like the macro is actually applying, because it never gets a link around it, even though all the ID3 tags are there.

I even added apply_macros="1" to the ping tag at the beginning of it. Anyone have any ideas what could be going wrong?

BTW, to see the output: http://www.brianslife.net/includes/music/incoming.php

by Brian at 10:31 PM on 07.19.03

Something anoying is when you listen to Webradio. Very often, the DoSomething plugin will end logging song title like "[HTTP...]" or "[Connecting]" or "[Buffer: 35%.."] etc ...

I have changed the DoSomething source code to filter these events properly.

You can get my custom, updated version here:

http://blog.nikita.cx/winamp/gen_dosomething.dll

by Francois at 02:37 PM on 07.29.03

I'm trying to get this to work here
It seems to be sending the pings but, all that comes up for the song titles is: %%CURRENTSONG%% - their links and everything are very messed up to.

by christianne at 04:07 AM on 08.01.03

I did everything listed... everything... and I made the new blog... category... I can see that the URLs are being submitted but for some reason... nothing on the main page of my blog.

by Sheila. at 10:02 PM on 08.02.03

I thought I did everything correctly but all that shows up on my site is a line that says "updated 08/08/03 04:44 PM". What am I doing wrong?

by Grace at 03:50 PM on 08.08.03

Sorry, me again. Now I'm getting a parse error in the incoming.php file

by Grace at 03:55 PM on 08.08.03

So erm I sorta have it working now... thanks for checking in the forums -http://movabletype.com/support

Thanks again.

by sheila. at 05:30 PM on 08.08.03

General note to all:
If you aren't sure that the data is really coming into your blog, you can create a test Index Template to see -- this content will show you all of the information that is being sent in the ping:


<MTPings category="incoming" lastn="50">
PingBlogName/Album: <$MTPingBlogName$><br />
PingTitle/Song by Artist: <$MTPingTitle$><br />
PingURL/blank: <$MTPingURL$><br />
<br />
</MTPings>

You should see lines that look like this:

PingBlogName/Album: Hotel Paper Michelle Branch
PingTitle/Song by Artist: Michelle Branch - It's You
PingURL/blank: http://blank

If not, then something isn't working between WinAmp, dosomething, and your trackbacks.

by kristine at 10:39 PM on 08.09.03

Update: Almost there!

Check out my post at
the forums

by Grace at 09:25 AM on 08.10.03

Winamp Hoverable Playlist thread on the Movabletype forums

by Sheila at 02:49 PM on 08.15.03

One problem I found (after much tearing of hair and gnashing of teeth getting it to work in the first place) is that if the corresponding album can't be found on Amazon.com, you'll get a blank div even though all the song information is showing in the category ping list. So much for my indie music collection :)

Someone posted (on the movabletype support forum, I think) that if the id3 tag contained parentheses, it wouldn't work; I don't seem to have that problem, but I noticed if the tag has the OPENING parenthesis but not the closing one, you end up with a blank div. (I guess that throws off the regex.)

Despite it all, this is still very cool, Kristine; thank you!

by Michelle at 04:39 PM on 08.30.03

This is a great modifcation/enhancement for your weblog. I did, however, find one glitch.

If in your mp3 tag you don't have the artist name properly formatted, then the link won't display properly.

For example, I had a song by BT featuring Rose McGowan. In the song title of the mp3, I had it listed a "BT feat. Rose McGowan." As a result, the link would not display at all. Once I changed the artist name to "BT" then everything worked just fine.

The glitch is in the Amazon coding, but I don't know what the fix would be. The ping is properly working, but when it tries to format for Amazon it screws up and doesn't display at all.

Other than that one little glitch, this modifcation works great and thank you so much for the fantastic tutorial!

by mashby at 02:10 PM on 09.01.03

Is winamp only there for pc's or can mac users user it??????

by Nakia at 02:33 AM on 09.07.03

It this not somehow possible with WMP 9 series it also supports plugins

by Arvind Satyanarayan at 11:55 PM on 09.17.03

I don't get what I'm doing wrong. I've just copied and pasted all the stuff from Virtual Venus. Everything is correct. Becuase my my incoming links page shows the songs I'm playing yet how do I acheive the hoverable thing ?. A basic idea how my page is. The Sidebar is a spearate index templates sidebar.php which is called through a php include from the main index. Where do i put the overlib stuff ? How do I put it ?

by Arvind Satyanarayan at 03:48 AM on 09.18.03

Pardon my ignorance, but I have no idea where the regex stuff goes ("I created a new Module named regex to store the amazon definition..."). Is this a separate file? Does it go into the Incoming template?

by Jeff at 01:26 PM on 09.25.03

Nevermind... I found where the regex stuff goes. It was my very first "module." :)

by Jeff at 11:57 AM on 09.26.03

I've followed the directions and set up all of the plugins required (except for remove pings because that link is dead), but the links nor overlib is working. The pings are being sent and displayed properly, just no links. Any suggestions on where to start troubleshooting?

by kim at 12:17 PM on 11.10.03

I've got this installed now after calling my computer bad names lots... But I have a bit of a problems with the display of the songs.

I thought I didn't have it working, until I realised that it was working with certain songs. It seems that when it doesn't find a matching album and artist, it won't display anything. Its fine for most albums, but for soundtracks it doesn't seem to like having the different artists, and I would rather keep the tags than change all the artists to "Various Artists". Is there anyway to get it just display the text if it doesn't find the link?

by Hazel at 10:58 AM on 11.15.03

All questions should be addressed in the Updated version of the tutorial.

To upgrade, check the html snippets for the Regex, Incoming, and Javascript sections, and update your Ping URL inside of dosomething.

by kristine at 04:38 PM on 02.01.04
Comments are closed on this entry
More Entries

Copyright © Virtual Venus