9) { $spaces = " "; } else { $spaces = " "; } //echo number + filename echo $i.$spaces.$matches_filename[$i][1]."\n"; $i++; } echo "\nAdd the number of the movie file you want to download to the end of the command you used to get here.\n\n"; } } } else { echo "Usage: TrailerDownloader.php URLOfTheTrailerPage\n\n"; //start reading rss. $apple_trailers_rss = @file_get_contents("http://trailers.apple.com/trailers/home/rss/newtrailers.rss"); $feed_parsed = new SimpleXMLElement($apple_trailers_rss); $feed_trailer_count = count($feed_parsed->channel->item); echo "Available Trailers\n"; $i=0; while($i<$feed_trailer_count) { //echo echo "* ".$feed_parsed->channel->item[$i]->link."\n"; $i++; } echo "\n"; } ?>