From 68f34d6c8f62086510286960e82ca1bbff2edd6a Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Thu, 13 Jan 2011 23:46:16 +0000 Subject: da files --- history.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 history.pl (limited to 'history.pl') 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; -- cgit v1.2.3