summaryrefslogtreecommitdiff
path: root/history.pl
diff options
context:
space:
mode:
Diffstat (limited to 'history.pl')
-rwxr-xr-xhistory.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/history.pl b/history.pl
new file mode 100755
index 0000000..204329e
--- /dev/null
+++ b/history.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+use strict;
+
+require RPC::XML;
+require RPC::XML::Client;
+use CGI qw(:standard);
+use CGI::Carp 'fatalsToBrowser';
+use URI::Escape;
+
+print header;
+print CGI::start_html('nzbget status');
+
+my $cli = RPC::XML::Client->new('http://nzbget:tegbzn6789@127.0.0.1:6789/xmlrpc');
+my $resp = $cli->send_request('history') or die "Can't connect to nubget";
+my $i=0;
+print CGI::start_table();
+foreach my $row (@{ $resp->value})
+{
+ $i++;
+ foreach my $key (keys %$row)
+ {
+ if (ref $row->{$key} eq 'ARRAY')
+ {
+ print Tr(td([$key,(join ',',@{$row->{$key}})]));
+ } else {
+ print Tr(td([$key,$row->{$key}]));
+ }
+ }
+}
+print CGI::end_table();
+;
+print end_html;