diff options
author | Othmar Gsenger <otti@wirdorange.org> | 2011-01-14 00:17:57 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@wirdorange.org> | 2011-01-14 00:17:57 +0000 |
commit | a60811a6efa731d8229b713fbb16cd9770ec143d (patch) | |
tree | f5049cacbf9ceac6b7cf13da001ea25979c20cfa /local/nzbget.pm | |
parent | da files (diff) |
added modules
Diffstat (limited to 'local/nzbget.pm')
-rw-r--r-- | local/nzbget.pm | 22 |
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"; +} |