X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite.pl;h=58ff284bed1e2eaa0c151a18360aa13aa7952e72;hb=26e6f7a1323284793a4ca890461e6cbb336bc27f;hp=bf14b9560f54a7db27a141d67cad07b29d0afa42;hpb=4faf1e5fcb46955cea9eaa04e4370c8bff767a84;p=videosite.git diff --git a/videosite.pl b/videosite.pl index bf14b95..58ff284 100644 --- a/videosite.pl +++ b/videosite.pl @@ -6,6 +6,7 @@ # Based on youtube.pl by Christian Garbs # which in turn is # based on trigger.pl by Wouter Coekaerts +# This is helena use strict; use Irssi 20020324 qw (command_bind command_runsub signal_add_first signal_add_last); @@ -19,7 +20,8 @@ my @getters; my $getter; my $conf; my $conffile = File::Spec->catfile(Irssi::get_irssi_dir(), 'videosite.xml'); -my $plugindir = File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts', 'videosite'); +my $scriptdir = File::Spec->catfile(Irssi::get_irssi_dir(), 'scripts'); +my $plugindir = File::Spec->catfile($scriptdir, 'videosite'); my $PARAMS = { 'getter' => '', @@ -272,9 +274,9 @@ sub cmd_help { } else { write_irssi(undef, <<'EOT'); Supported commands: - save: Save the current configuration - help [modulename]: Display this help, or module specific help - show [modulename]: Show loaded modules, or the current parameters of a module + save: save the current configuration + help [modulename]: display this help, or module specific help + show [modulename]: show loaded modules, or the current parameters of a module set modulename parameter value: set a module parameter to a new value getter [modulename]: display or set the getter to use enable [modulename]: enable the usage of this module (grabbers only) @@ -292,8 +294,8 @@ sub cmd_getter { my $p; if (defined($target)) { - foreach $p (@getters, @grabbers) { - if (($p->{'NAME'} eq $target) && ($p->{'TYPE'} eq 'getter')) { + foreach $p (@getters) { + if ($p->{'NAME'} eq $target) { $getter = $p; $conf->{'videosite'}->{'getter'} = $target; return; @@ -346,13 +348,13 @@ sub ploader { foreach $p (@list) { write_debug(undef, "Trying to load $p:"); $p =~ s/\.pm$//; - eval qq{ require $p; }; + eval qq{ require videosite::$p; }; if ($@) { write_irssi(undef, "Failed to load plugin: $@"); next; } - $g = eval $p.q{->new();}; + $g = eval qq{ videosite::$p->new(); }; if ($@) { write_irssi(undef, "Failed to instanciate: $@"); delete($INC{$p}); @@ -492,5 +494,5 @@ sub cmdhandler { } } -unshift(@INC, $plugindir); +unshift(@INC, $scriptdir); init_videosite(1);