summaryrefslogtreecommitdiff
path: root/local/nzbget.pm
diff options
context:
space:
mode:
Diffstat (limited to 'local/nzbget.pm')
-rw-r--r--local/nzbget.pm22
1 files changed, 22 insertions, 0 deletions
diff --git a/local/nzbget.pm b/local/nzbget.pm
new file mode 100644
index 0000000..ea3b47a
--- /dev/null
+++ b/local/nzbget.pm
@@ -0,0 +1,22 @@
+package local::nzbget;
+require Exporter;
+require RPC::XML;
+require RPC::XML::Client;
+use strict;
+use base "Exporter";
+
+sub new
+{
+ my $invocant = shift;
+ my $class = ref($invocant) || $invocant;
+ # my $self = $class->SUPER::new(@_);
+ my $self=bless {@_}, $class;
+ $self->{cli} = RPC::XML::Client->new('http://nzbget:tegbzn6789@127.0.0.1:6789/xmlrpc');
+ return $self;
+}
+
+sub send_request
+{
+ my $self = shift;
+ return $self->{cli}->send_request(@_) or die "Can't connect to nzbget";
+}