Slashdot Mirror


Controlling iTunes with Perl

EccentricAnomaly writes "brian d foy has created perl modules for controlling iTunes. His modules, Mac::iTunes and Apache::iTunes, can be found on the CPAN. Now perl mongers can run iTunes remotely via the command line or via a web interface on a Mac hooked-up to a nice stereo to use as a home or office jukebox. I shudder to think what else may be possible now that iTunes is in perl's clutches."

5 of 47 comments (clear)

  1. Re:uh, aren't there other players? by bdash · · Score: 3, Interesting

    When using Mac OS X I try as hard as possible to avoid 'ports' of *nix software. This is simply because unless a decent job has been done on the porting, the look and feel just does not fit with the rest of the system. To make a *nix application fit in with the look and feel of the system would require a substantial amount of modification to the code, sometimes enough that it would be easier to just start from scratch.

  2. With a little help from AppleScript, I might add by djupedal · · Score: 5, Interesting

    The PERL needs AppleScript to talk to iTunes. It doesn't do it on it's own...been there and doing the same thing with PHP :)

    Check my gallery site that lets visitors also spy on my currently playing song, etc. I use PHP and MySQL to manage a Mac and Linux (2 box combo) image database. Just for fun, PHP, along w/AppleScript, pulls data from iTunes, while it supports image serving, uploading, resizing, etc. Ho Ho Ho

  3. Re:For Darwin for OSX by jcr · · Score: 3, Interesting

    Well no:

    1) Used by only one vendor and is going to remain that way


    That one vendor is the UNIX volume leader.

    2) It is tied to a particular hardware model and thus is likely to be outdated within a decade

    No, Quartz is quite hardware-independent.

    3) It is not network transparent which has been a Unix feature on GUIs for 2 decades and on the system itself for 3 decades

    Ok, I'll give you that one. The benefit of Quartz 2d's rendering library living in the app's address space though, is increased 2-d rendering performance.

    4) The vast majority of Unix apps don't support it

    This will change. A lot of X-windows apps are getting new GUIs as we speak.

    5) If you include X windows servers running on PCs and dumb X terms I'm not sure it has more users than X so even your sole reason for considering it standard may not be.

    I'm not sure that X terms make much difference in the figures.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  4. Re:With a little help from AppleScript, I might ad by WatertonMan · · Score: 4, Interesting
    Just out of curiousity, how do these Perl scripts work if there is no user currently logged into OSX? After all iTunes works in a user mode. If you call the Perl script and no user is logged in, will it work?

    If this is the same code that was discussed over at O'Reilly you need to start tweaking how Apache or other things run.

    There was a discussion of this over at MacNN Forums as well.

  5. Re:With a little help from AppleScript, I might ad by WatertonMan · · Score: 3, Interesting
    You miss the point. Applescript works with the Window Manager running which runs as a user. The problem is that if no one has logged in then iTunes can't run and the Perl script won't work. If you are running your Perl scripts from Apache this can cause problems. Further if you try to make it more robust you open up all sorts of security holes.

    Both links I provided discussed this in depth.

    I was curious if the Perl scripts mentioned were simply calling the same Applescripts and how they dealt with these issues. My sense was that they were variations on the similar Perl code discussed at the MacDev page at O'Reilly.

    Capiche?