#!/usr/bin/perl -w
+# Display the current status of a MythTV system.
+
use LWP::Simple;
use XML::LibXML;
use Date::Manip;
use Getopt::Long;
+# Some sane defaults.
my $host = "localhost";
my $port = "6544";
our $today = substr(ParseDate('today'), 0, 8);
our $tomorrow = substr(ParseDate('tomorrow'), 0, 8);
+# The blocks of output which we might generate.
my @blocks = (
+ # Info about the encoders.
{
'name' => 'Encoders',
'xpath' => "//Status/Encoders/Encoder",
'state' =>{ '0' => 'Idle', '4' => 'Recording' },
}
},
+
+ # What programs (if any) are being recorded right now?
{
'name' => 'Recording Now',
'xpath' => "//Status/Encoders/Encoder/Program",
'endTime' => { 'T' => ' ' },
}
},
+
+ # The upcoming recordings.
{
'name' => 'Scheduled Recordings',
'xpath' => '//Status/Scheduled/Program',