KDingo MusicStalker v0.02 9/1/08

Documentation/FAQ

Music Stalker, by KDingo, 7/16/2005, 3/12/2007, 9/1/2008
experimental song snapshot script
written in PHP and MySQL
somewhat based on info_sender, by appel [-at-] nr78.net, a txt script

About

Music Stalker is a service that "snapshots" your current or last playing song, whether it be an MP3 or CD, or any other audio medium, and makes it presentable for everyone else viewing Music Stalker. Any person at one moment can view these snapshots in real time. Additionally, Music Stalker isn't platform-dependent, so potentially anyone running any music player can use Music Stalker, provided the player has the capability to visit or send a URL using standard HTTP POST or GET. Usually this is done using a script, and a script is provided separately from this site.

Syntax

Music Stalker accepts scripts using POST or GET methods of HTML forms, as well as flexible formatting for text sent to the server. All a script has to do is send a URL to Music Stalker, and the server will parse the URL from there. The URL for the script to send it will begin with "http://www.kdingo.net/musicstalker/play.php". The most basic syntax (and default format from Music Stalker's predecessor) is GET method with one song variable. The server automatically decodes your urlencoded variables.

GET, 1 variable
...play.php?uid=0&pass=exmpl&song={song,artist,album-here}

With this example, you will format the script to send song information where the song variable is.

GET, multiple variables
...play.php?uid=0&pass=exmpl&title=songtitle&artist=songartist&album=songalbum

With multiple variables (which are customizable in options), there will be no mistaking what MusicStalker determines as title, artist, and album, which may happen with the former example depending on song format.

Using POST

If your script supports it, you can send the same song information using POST, as long as the base of the URL remains the same: "http://www.kdingo.net/musicstalker/play.php"

Defaults

One Variable Format

Typically in most music players, a song is formatted "Artist - Title (Album)" where the short hyphen "-" and the parentheses "()" are used to separate the three pieces of information sent to Music Stalker. The default single variable name is 'song', but this is changable.
The hyphen separator is also changeable in your Profile page. Additionally, you have the option to swap the Artist and Title if your player sends the song info out like that.

Multiple Variables

Whether using POST or GET, you have the option to have the server parse your data as one big variable or by multiple variables. You can set these variable names in your profile page. Using one variable, the default variable name is 'song'. Using multiple variables, the default variable name for the Song Title is 'title', Song Artist is 'artist', and Album is 'album'.

Realize when using cURL that you need to set the '-G' option when using HTTP GET, and to omit it when using POST.

Supported programs

Most of the time, the capability to send a URL is handled by scripts to the player, which is downloaded separately. So far, I've used two programs definitely able to do this: Winamp for Windows, and Amarok for Linux/KDE.

Winamp

Winamp can send a URL through the Do Something plugin.

Your URL will be formed like:

http://www.kdingo.net/musicstalker/play.php?uid=yourid&pass=yourpass&song=%%URL_CURRENTSONG%%

URL_CURRENTSONG will send song names as it appears in Winamp. You may also substitue this or put in combination with the other URL_ tags, all listed in the Do Something appendix. The Do Something plugin does not support HTTP POST.

amaroK

This is one of the popular KDE applications for Linux. Additionally, it supports scripting for many different languages and I made my own script to take advantage of MP3 Stalker. amaroK can send a URL with mp3urlnotify.

Your Base URL will be formed like:

http://www.kdingo.net/musicstalker/play.php?uid=yourid&pass=yourpass&song=

The script appends the Base URL with the current song as shown in the amaroK player.

foobar2000

Foobar is a lightweight player based off of Winamp code. You can use MP3 Stalker with the AIMP plugin and cURL installed. AIMP is originally meant for displaying now-playing information with an IRC client, namely mIRC, but can be used independently to send URL data. Download the plugin and its Java configuration utility, and as well as cURL for Windows (the non-SSL version).

You will set the Play preset like:

/exec:(curl.exe) -G -d "uid=yourid&pass=yourpass&song=&func_ue(%name)" http://www.kdingo.net/musicstalker/play.php
XMMS

This player for Linux has pseudo-native support to send a URL. Through the Song Change plugin which is already installed, XMMS will run a program after a song change. the command to use is similar to the amaroK script using curl.

curl -G -d "uid=yourid&pass=yourpass&song=%s" http://www.kdingo.net/musicstalker/play.php

You can also create a shell script which converts spaces, percentage signs, ampersands, etc. before sending off the song name with curl. Here is a sample template called xmms_urlnotify.sh:

#!/bin/bash
BASE_URL="http://www.kdingo.net/musicstalker/play.php"
SONG_NAME=`echo "$*" | perl -MURI::Escape -lne 'print uri_escape($_)'`
curl -G -d "uid=0&pass=exmpl&song=${SONG_NAME}" ${BASE_URL}

Then call the script from the Song Change plugin:

~/xmms_urlnotify.sh "%s"

Untested Programs

Some happen to have a send URL capability but I have not tested them.

iTunes
A plugin exists called Recent Tunes. You can send recently-played list or the currently played song.

©2005-8 kdingo