diff options
author | Othmar Gsenger <otti@wirdorange.org> | 2011-01-13 23:46:16 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@wirdorange.org> | 2011-01-13 23:46:16 +0000 |
commit | 68f34d6c8f62086510286960e82ca1bbff2edd6a (patch) | |
tree | 954106bec3992733b0102aec4e6b1351ad0a20c9 /history.pl | |
parent | added inital svn dirs (diff) |
da files
Diffstat (limited to 'history.pl')
-rwxr-xr-x | history.pl | 32 |
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; |