0r9 .org
 
“Organization ((unofficial)) of the disorganized.
Don't ask! We can't find it.”
Back to Labs


SqueezePHPAPI

About

The SqueezePHPAPI is a PHP5 API for the SqueezeCenter Music Server and SqueezeBox Players and Streams.

If you don't know what SqueezeCenter is then let me fill you in:

The SqueezeCenter Software is a really awesome open source streaming music server coded in PERL.
Visit the slimdevices wiki to find out more.

Why

I coded this set of classes because I wanted to write some custom scripts to control my SqueezeBox ((basically I wanted to automatically turn the volume down when a telephone call came in over my Asterisk/FreePBX server, also to display the calling number on my SqueezeBox player)). I could have used PERL, most development done with SqueezeCenter is PERL, but I find web development to be more rapid with PHP, also PHP is arguably more wide spread on the web than PERL, so I thought:

Wouldn't it be really cool to enable other PHP Developers to play with the SqueezeCenter so they could make some really awesome apps.

Anyway once I started wading through the CLI tech specs I couldn't help myself and kept on coding.

Actually this API is still not quite finished/fully tested, probably, about 98% is done. There are a few things I would like to do to proxy a stream, as well as some other fixes. But it does work from what I have checked. There was alot of time and effort spent to get this far. Hopefully I will get to slowly improve it over time and set the last API features in stone. But dont let this stop you from downloading the classes and coding some nice applications.

What

What can the SqueezePHPAPI do? Well basically everything that can be done via the SqueezeCenter Command Line Interface. You can search / rescan your music server / library; start, stop and change your player volumes; create and modify playlists; set alarms and much much more.

How

Three (3) Four (4) Five (5) steps to get started.
((Assuming you already have a fully installed SqueezeCenter and have access to a PHP5 enabled web server.))

  1. Agree to the License
  2. Read the SqueezePHPAPI Documentation Yes! There is documentation!
  3. Download SqueezePHPAPI (~ 70Kb) Initial Release v0.1 then unpack
  4. Look at the example PHP code and read the SqueezePHPAPI Documentation AGAIN!
  5. Have fun!

If you try the basic_example.php file on your server you should get an output similar to this.

Help

If you find any bugs or know of some improvements please dont hesitate to drop me a line. ((My email is in the code)) As the SqueezeCenter music server changes I hope to make this set of classes change with it.



This page last updated: Thursday, 17 September 2009 9:26:28 PM

Sorry not much else to look at here! You can go Home or visit the The Store.
I also have a Privacy / Terms of Use Statement.