|
|
Introduction
This PHP script exposes iTunes as a web service, returning data in JSON. Using this service, you could create a web site to control iTunes; this is great for households with a centralized iTunes media system. The inspiration for this library came from the following sources:
Files
- itunes.php - The main controller file that exposes iTunes as a web interface.
- scripts/itunes.js - A Javascript client built on top of the iTunes Web Service using XMLHttpRequest
- itunesexample.html - An example web page that shows off the various functions of the files above.
Installation
The installation is very similar to what is described in Jordan's original post.
- Install a web server. BRS Web Weaver is recommended. Apache has some permissions issues which cause it to fail, and I haven't had the time to look into the issue.
- Install PHP.
- Configure the php.ini file. Set the value 'com.allow_dcom' to true.
- Configure the web server for PHP. Under Options -> Server Config, navigate to HTTP Server -> PHP. Check the "Enable PHP Processing" checkbox. Set "Location of PHP.EXE" to the php-cgi.exe file in your php installation directory.
- Put the files above somewhere in your web directory. This is usually the "docs" folder in the WebWeaver installation directory.
- Visit the itunesexample.html page and try some of the functions. In previous posts I've read that iTunes needs to be launched before accessing its api. In the version I'm currently using (6.2), iTunes automatically launches when the first api request comes in.
Contact
If you have any questions or comments, contact me at the username above, at gmail.com.
