Yvonne (absolut) wrote in component_help,
Yvonne
absolut
component_help

  • Mood:

Now Playing Component

This was requested earlier by panda_cookie. This tutorial will explain how to get your currently playing song on your music player to show up as an image on your livejournal using AMIP. It's my first tutorial, so let me know if you don't understand something. If it doesn't work, I can try and help.

1. Requirements
This should work with the following music players - Winamp, Foobar, QCD, or iTunes (Windows).

You'll need a web host with the following requirements:
- Upload by FTP
- PHP 4.2.2+
- GD Support enabled
- FreeType Support enabled
- JPG/PNG Support enabled

There are plenty of free web hosts out there, but not all of them may meet the requirements.



2. Download and Install
Go to the AMIP Downloads page and download the appropriate file for your music player. You'll also need to download the AMIP Dynamic Signature Package v0.4 package near the bottom of the page.

Unzip the first file and run the AMIP-2.51 executable file, which will install a plugin into Winamp. Then, unzip the contents of the other file onto your hard drive, such as in the location C:\.

3. Configure

Upload the "np" folder (if you unzipped all the files to the C:\ drive it should be in c:\np\) and all the files in it onto your web server.

Open up the file amipweb.conf (located in the "amipweb" folder) in a text editor. Find the line
url = http://CHANGE_THIS_URL/np/signature.php
and change it to the address of the files on your webhost.

Next is configuring the music player. The instructions below are for Winamp, I'll get to the iTunes configuration afterwards. As for the other players, I don't use them, so I'm not exactly sure how to configure those, but it should be nearly the same.

Winamp
Open up Winamp (if you had it open while you were installing the AMIP plugin, you have to restart). Press Ctrl-P to open up the Preferences Window. In the menu, under "Plugins", select the "General Purpose" item. There should be a line saying "Advanced mIRC Integration Plug-In v2.51 (gen_irc.dll)". Select it, and then click on the "Configure selected plug-in" button at the bottom. A new window should pop up.

At the bottom of the window, there is a little text box with some text in it. Erase it, and paste in the following:


/template:(c:\amipweb\amipweb.conf) c:\amipweb\amipweb.out
/exec:(c:\amipweb\curl.exe) -K c:\amipweb\amipweb.out


Click on the OK button to close the window, and then close the preferences window.

iTunes
Open up iTunes and press Ctrl+Alt+Shift+O. A new window will pop up up. In the menu, under "IRC Integration", select "Presets". A text box should appear on the right. Clear everything that's in there, and paste in


/template:(c:\amipweb\amipweb.conf) c:\amipweb\amipweb.out
/exec:(c:\amipweb\curl.exe) -K c:\amipweb\amipweb.out


Then click OK to close the window.

4. Run

That should be it! If you're playing music in your player, open up http://CHANGE_THIS_URL/np/signature.php/sig.png (substitute in your site address) in your browser and you should be able to see the song info in the image. It should look something like this.

If you want to do some further customizations, read the readme files from all the stuff you downloaded for more info. If you know php you can edit the configuration in the "signature.php" file. I customized mine to look like this.

5. Add to Component

Put this somewhere in the print_free_text(Page p) function (see this for reference)


##################################################
# Now Playing Component #
##################################################

print_comp_header("Now Playing");
"""
<img src="http://CHANGE_THIS_URL/np/signature.php/sig.png" width="455" height="55" alt="now playing" />
""";
print_comp_footer();


Again you'll have to substitute in your own site info.

The default image is quite big so if you place the code on your sidebar it'll probably stretch it out. So I'd change the code to something like this:


##################################################
# Now Playing Component #
##################################################

print_comp_header("Now Playing");
"""
<div style="width: 200px; overflow: auto;">
<img src="http://CHANGE_THIS_URL/np/signature.php/sig.png" width="455" height="55" alt="now playing" />
</div>
""";
print_comp_footer();
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 15 comments