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."

8 of 47 comments (clear)

  1. 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

  2. Re:uh, aren't there other players? by goon+america · · Score: 4, Insightful
    iTunes is really just a fancy organizer for Quicktime. The Quicktime libraries are so big, and so useful that any multimedia app for the Mac uses them for everything.

    The Windows Media Player for OS 9 was "powered by Quicktime", hilariously enough.

  3. Remote? by Trusty+Penfold · · Score: 4, Funny


    Controlling music remotely is only useful when there is a function to turn the volume to 11.

  4. Re:uh, aren't there other players? by Melantha_Bacchae · · Score: 5, Informative

    bdash wrote:

    > When using Mac OS X I try as hard as possible to
    > avoid 'ports' of *nix software.

    Don't look now, but your hard drive has many ports of Unix software that were installed with OS X. But that is because OS X really is Unix.

    > 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.

    It depends on how separate the user interface is from the rest of the code. If the user interface is well separated, you can just toss that, write a new one in Cocoa, and keep the behind the scenes code. If the program has no graphical user interface, such as say MySQL (an open source back end database program), you can do a fairly straight port.

    In this case they are talking about adding the ability to script iTunes with the Perl language the same as you would with AppleScript. No look and feel is involved, and if you don't know Perl you probably wouldn't be using it.

    Chief Tsujimori: "I won't let you get away. I will never let you escape."
    Godzilla elegantly lifts his tail skyward to give her the "finger", crashes it down on the water, and submerges.
    "Godzilla X Megagiras", 2000

  5. Re:With a little help from AppleScript, I might ad by kalidasa · · Score: 4, Insightful

    The original posting should have made this point, as my original reaction was "why use Perl rather than AppleScript"; reading the article, I see there is a good argument in favor of using Perl along with AppleScript, but I imagine I wasn't the first one to go to the page with that thought at the top of my mind.

  6. Re:For Darwin for OSX by jcr · · Score: 4, Informative

    Because OSX has an entirely non standard Gui (from a Unix perspective) that isn't based on X;

    Things change. Quartz/Aqua is now the the standard GUI for UNIX, since Mac OS X is far and away the most-numerous UNIX there is.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  7. Re:For Darwin for OSX by jbolden · · Score: 5, Insightful

    Well no:

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

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

    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

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

    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.

  8. 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.