Welcome to spinsys documentation, version .01.   I hate writing
documentation.  Its 4:00am.  Why am I doing this?  Oh, thats
right.. boredom.


------
What is spinsys?

Spinsys is software for a streaming mp3 radio station.  See it live @
http://spinsys.knowfear.net.  More info?  Ok.  I wrote it because I wanted
a streaming mp3 station that was completely php.  I wanted to be able to
vote for the song I wanted to hear, and then hear it.  I didn't want to
have to wait for the player to decide to play it eventually based on it
being weighted slightly higher than the other songs (point of
non-interest: there was a version of spinsys that did that.  for about 5
minutes.  I didn't like it.).  

Neat stuff?  All the streaming is in php.  I haven't seen anybody else do
that.

Everything under spinsys is GPL'd.  Do whatever you want with it.  I'm not
responsible for anything weird that happens.  If you're using it, please
let me know, mcfadden@athenet.net.  Thanks.


-----

Requirements:

These requirements would basically dictate that you're running it on your
own system, or have a very nice sysadmin.  

I have no idea what kind of processor you need.  I run it on a p5-100 with
48 megs of ram thats doing tons of other stuff and don't have any
problems.

Mysql.  You need mysql.  But you should have mysql anyway.  It rules.

Php.  You need php.  Php makes me smile.  You need php4 I think.  When I
ran this code with php3 it would (after 20 days or so) eat up all my swap
space.  I dont know why.  php4 doesn't do that.  Also: you need both php
setup for apache and for a command line binary.  Easiest way to get the
binary is to go into a php source directory and do ./configure followed by
make.  That will give you a 'php' file.  Copy that to like /usr/local/bin. 

Icecast.  Get it.  www.icecast.org.  Its free.  Its easy to
setup. 

Mp3s.  You need a lot of mp3s.  My server currently has 548 in the
rotation, and thats not really enough.  Hence, you need a bunch of storage
too.

-----

Installation.  

NOTE: THIS ASSUMES YOU ALREADY SETUP MYSQL/APACHE/PHP

I've included the mysql dumps for creating the two tables you need.  Its
mp3list.dump and playing.dump.  Its up to you to get that into your copy
of mysql.  (hint, cut and paste them into an open mysql client window).

Modify connect.php3 to connect to your mysql server with your proper
username/password.  Also tell it the db you're using.  

Modify listen.m3u to point to your URL.

Modify player.php3 around line 18 to point to your icecast server.

Modify top.php3/bottom.php3 to look the way you want them.

Modify upload.php3, replace /archive/mp3 with wherever you want your mp3s
to go.

Start your icecast server.  I usually run this in a screen so I can call
it up later to see whats going on.  You can also probably daemonize it.

Add some songs.  You need at least 6 songs in your list before you start
streaming.   So, how do you add songs?  Glad you asked.

First, right now spinsys is setup to only accept mp3s above 96kbps.  To be
'leet, you should really only run with one bitrate, but spinsys code will
dig it even if you dont.  Some mp3 players might freak out though.

Anyways, adding a song.  Bring up "postform.html" in a webbrowser.  Browse
your harddrive and find an mp3 you want to add.  If its in "Artist -
Songname" format, hit "update" and javascript will magically fill in
band/songname fields.  If that doesn't work, leave them blank and hit
sendfile, the upload code will try to read the id3 tag and fill in the
info for you.  If that fails too, it will prompt you to enter the
band/songname manually.  

Ok, so you've got 6 songs added?

Start up another screen and run player.php3.  It will start its magic
hopefully.  You're all set.  Enjoy!

Any questions?  Oh boy there are going to be questions.  This probably
doesn't even make sense to me.  Anyways, email mcfadden@athenet.net.  

-sith

