Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

First working version

  • Loading branch information...
commit b67b4f3044b81e0ee1b74e939202784d811422d8 0 parents
Neil Crosby authored
1  control/playnext.applescript
... ... @@ -0,0 +1 @@
  1 +tell application "iTunes" of machine "eppc://macmini-2.local" to play (next track)
1  control/playpause.applescript
... ... @@ -0,0 +1 @@
  1 +tell application "iTunes" of machine "eppc://macmini-2.local" to playpause
1  control/playprev.applescript
... ... @@ -0,0 +1 @@
  1 +tell application "iTunes" of machine "eppc://macmini-2.local" to play (previous track)
54 playlist/index.php
... ... @@ -0,0 +1,54 @@
  1 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2 + "http://www.w3.org/TR/html4/strict.dtd">
  3 +<html lang="en">
  4 +<head>
  5 + <title>Neil's Current Playlist - blah</title>
  6 + <style type="text/css">
  7 + * {
  8 + background: #fff;
  9 + color: #000;
  10 + }
  11 +
  12 + .current td {
  13 + background: #fab;
  14 + color: #000;
  15 + }
  16 + </style>
  17 +</head>
  18 +<body>
  19 +<table>
  20 +<?php
  21 +
  22 +$json = <<<JSON
  23 +{{"453E2A19AEFD2AAC", "453E2A19AEFD8AB0", "453E2A19AEFD4F64", "453E2A19AEFD5482", "453E2A19AEFD2C01", "453E2A19AEFD4425", "8C9C16B2D2C70755", "453E2A19AEFD5245", "453E2A19AEFD78F6", "3C8ABC721C537E64", "05BFA94137C96F42", "453E2A19AEFD2AAE", "453E2A19AEFD2D38", "453E2A19AEFD34DB", "CE726B593088CCBB", "D793A2CB333B2C67", "453E2A19AEFD547E", "453E2A19AEFD4428", "8C9C16B2D2C70765", "453E2A19AEFD34E0", "453E2A19AEFD710E", "453E2A19AEFD89FE", "453E2A19AEFD2AB4", "453E2A19AEFD282F", "453E2A19AEFD34F2"}, {"Everyone Has AIDS", "Now You're a Man", "Mr.Hanky The Christmas Poo", "Sweet Transvestite", "I'm Super", "Kidnap The Sandy Claws", "We've Got to Do Something", "Me Julie", "Cuban Pete", "Rock Me Sexy Jesus", "Back To The Future", "America, Fuck Yeah", "Summer Nights (John Barrowman)", "''Battle Without Honor Or Humanity''", "Duel Of The Fates", "So They Say", "Science Fiction-Double Feature", "Oogie Boogie's Song", "Dracula's Lament", "''The Lonely Shepherd''", "The Imperial March (Darth Vader's Theme)", "Batman Theme", "Montage", "Be Prepared", "L Arena"}, {"Team America: World Police", "DVDA", "South Park", "Rocky Horror Picture Show", "Big Gay Al", "The Nightmare Before Christmas", "Infant Sorrow", "Shaggy/Ali G", "Jim Carrey", "The Ralph Sall Experience", "Alan Silvestri", "Team America: World Police", "Grease", "Tomoyasu Hotei", "John Williams", "Ensemble", "Rocky Horror Picture Show", "The Nightmare Before Christmas", "Jason Segel", "Zamfir", "John Williams", "Danny Elfman", "Team America: World Police", "Jeremy Irons With Whoopi Goldberg, Cheech Marin And Jim Cummings", "Ennio Morricone"}, {"Team America: World Police OST", "", "Mr. Hankey's Christmas Classic", "Rocky Horror Picture Show", "South Park: Bigger, Longer & Uncut", "The Nightmare Before Christmas", "Forgetting Sarah Marshall (Original Motion Picture Soundtrack)", "", "The Mask OST", "Rock Me Sexy Jesus (From \"Hamlet 2\") - Single", "Back To The Future", "Team America: World Police OST", "Showtime!", "Kill Bill (Volume One)", "YTMND Soundtrack - Volume 05", "Dr. Horrible's Sing-Along Blog (Soundtrack from the Motion Picture)", "Rocky Horror Picture Show", "The Nightmare Before Christmas", "Forgetting Sarah Marshall (Original Motion Picture Soundtrack)", "Kill Bill (Volume One)", "Star Wars- The Empire Strikes Back", "Batman OST", "Team America: World Police OST", "The Lion King (OST)", "Kill Bill (Volume Two)"}, "8C9C16B2D2C70755"}
  24 +JSON;
  25 +
  26 +//exec("osascript -s s /Users/neilcrosby/Sites/playlist/playlist.scpt", $json);
  27 +exec("/Users/neilcrosby/Sites/playlist/playlist.sh", $json);
  28 +
  29 +$json = implode($json);
  30 +$json = str_replace('{', '[', $json);
  31 +$json = str_replace('}', ']', $json);
  32 +
  33 +$data = json_decode($json);
  34 +$count = sizeof($data[0]);
  35 +
  36 +$current = $data[4];
  37 +
  38 +for ($i=0; $i < $count; $i++) {
  39 +
  40 + $class = ($data[0][$i] == $current) ? ' class="current"' : '';
  41 +
  42 + echo <<<HTML
  43 +<tr id="track_{$data[0][$i]}"$class>
  44 + <td>{$data[1][$i]}</td>
  45 + <td>{$data[2][$i]}</td>
  46 + <td>{$data[3][$i]}</td>
  47 +</tr>
  48 +HTML;
  49 +
  50 +}
  51 +
  52 +?>
  53 +</table>
  54 +</body>
13 playlist/playlist.applescript
... ... @@ -0,0 +1,13 @@
  1 +set tracks_list to {}
  2 +
  3 +tell application "iTunes"
  4 + tell current playlist
  5 + tell tracks
  6 + set tracks_list to get {persistent ID, name, artist, album}
  7 + end tell
  8 + end tell
  9 +
  10 + set tracks_list to tracks_list & {persistent ID of current track}
  11 +end tell
  12 +
  13 +get tracks_list
5 playlist/playlist.sh
... ... @@ -0,0 +1,5 @@
  1 +#!/bin/sh
  2 +
  3 +export DYLD_LIBRARY_PATH=""
  4 +
  5 +osascript -s s playlist.scpt

0 comments on commit b67b4f3

Please sign in to comment.
Something went wrong with that request. Please try again.