Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Can mint track hits to my shoutcast stream?

Posted on Aug 31, '07 at 03:17 am

Hi guys,

I am currently running Mint on my streaming radio station - and I would like to be able to track hits to the stream itself, especially in cases where the rest of the page is bypassed and listeners go straight to the stream url.

I am using shoutcast, and the stream url is like this: http://example.net:8000/listen.pls

Is there any way that this can be tracked within mint?

Thanks so much! Jonathan

Posted on Sep 01, '07 at 10:21 pm

I would love to find a pepper that can interface with shoutcast admin for listener stats or the shoutcast xml, or even to parse the log for hits to the shoutcast server. I think there might be numerous ways of doing this. This would be fantastic!

Third-Party Pepper Developer
Posted on Sep 02, '07 at 02:05 am

I’d be interested in writing this Pepper as soon I finish this next version of my current Pepper. I haven’t dealt with shoutcast any so I don’t know how it can be done but I’m sure we can find a way.

Find some more people that would be interested in this.

Posted on Sep 02, '07 at 05:27 am

That sounds great mate. I should be able to provide you with a test environment. There must be someone else out there running Mint on their shoutcast radio station!


This is definitely interesting to me too. What sort of data are you looking for?

For live, curently playing data, that’s actually the easiest to work with because we can parse the xml admin feed but that’s less useful, since you can essentially get the same information from the web admin interface.

What I think you’re after and what I think would be most useful for an online radio station is what clients (Winamp, iTunes, etc) are tuning in, how long each visitor listened for, what streams they listened to (for example what songs, which DJs), etc. For that we need to parse the shoutcast logs.

And that can get tricky depending on the update frequency. On a really busy shoutcast server, you have new people dropping out and tuning in every second.

Do you update every time you go view mint (long wait while the tail of the log is parsed) or do you do it incrementally? (eg a cron job).

I’m thinking what would be cool is a 2 tabbed pepper… one that basically reformats the shoutcast feed (and could refresh the data ajax-style on a user-defined increment). The other tab would show the log’s parsing.

Posted on Sep 04, '07 at 07:27 pm

That’s exactly the sort of data I wanted to capture, I had been looking at some log parsing software, but a mint would be so much better.

I’d definitely like to capture the stats from the XML feed as well, and not have to use the shoutcast admin, so I think a 2 tabbed pepper would be the way to go. I’d really like to see where listeners are coming from, how long they stay etc.

One problem is that when I post the direct link to my stream (http://krankydigital.com:8000/listen.pls) on other pages or forums, when people click on that link, they don’t appear as referrers in Mint, as Mint is not tracking hits to that file, and I’d really like to see referrers that point to the stream itself.

I just took a look into my sc log… currently shoutcast doesn’t track referrers and as far a I know, there’s no way to change that.

what I would do is just setup a redirect on the domain you can track.

Posted on Sep 06, '07 at 12:52 am

How would I do that? ;)

OK, I dug into this a bit… it’s actually a lot simpler than it is to explain. ;)

For starters, I would just drop the port number when you advertise the stream. for example, tell people to link to:


To make this work, you need to tell Apache to treat the .pls file like as a php file. In .htaccess, rewrite that playlist file to forward to your tracking script (listen.php for example):

RewriteRule ^listen.pls$ listen.php

At this point, you can easily call mint or any other parsing software because your .pls playlist is really a php file. Do all your stats tracking business then send them the actual pls file:

echo "[playlist]\nNumberOfEntries=1\nFile1=http://krankydigital.com:8000/"

This has the added benefit (?) if users copy and paste that url into WinAmp (or another program), the listening program will also show up in the Apache logs.

Posted on Dec 19, '07 at 10:15 pm

Hmm thanks for this solution SpinThis, I will look at doing this soon and let you know how it goes. :)

You must be logged in to reply. Login above or create an account

Hey there, I have officially suspended sales and support of Mint. The Create Account, Add License, Transfer License, and Contact forms have been disabled. Existing customers may continue to login and download Mint.

More info Continue