X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite.pl;h=847e627c9498ad02dc42d5c547564156ec47a2c2;hb=ffc24eec49bbdb6117e3a67e6080c119fba6575d;hp=0d4b3e32aa3b15b894b0d47cb8ca72a311a80686;hpb=d738e03f4f2d70a41eba8b77177826d1ff62f42b;p=videosite.git diff --git a/videosite.pl b/videosite.pl index 0d4b3e3..847e627 100644 --- a/videosite.pl +++ b/videosite.pl @@ -3,11 +3,9 @@ # (c) 2007 by Ralf Ertzinger # licensed under GNU GPL v2 # -# based on trigger.pl by Wouter Coekaerts -# download strategy revised using -# http://www.kde-apps.org/content/show.php?content=41456 -# # Based on youtube.pl by Christian Garbs +# which in turn is +# based on trigger.pl by Wouter Coekaerts use strict; use Irssi 20020324 qw (command_bind command_runsub signal_add_first signal_add_last); @@ -80,10 +78,15 @@ sub check_for_link { $witem = Irssi::window_item_find($target); } + # Look if we should ignore this line + if ($message =~ m,(?:\s|^)/nosave(?:\s|$),) { + return; + } + # Offer the message to all Grabbers in turn foreach $g (@grabbers) { if (defined($m = $g->get($message))) { - write_irssi($witem, '%%R>>> %%NSaving %%Y%s%%N %%G%s', $m->{'TYPE'}, $m->{'TITLE'}); + write_irssi($witem, '%%R>>> %%NSaving %%Y%s%%N %%G%s', $m->{'SOURCE'}, $m->{'TITLE'}); unless($getter->get($m)) { write_irssi($witem, '%%R>>> FAILED'); } @@ -94,7 +97,7 @@ sub check_for_link { sub cmd_save { open(CONF, '>'.$conffile); - print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => ['module', 'key']); + print CONF XML::Simple::XMLout($conf, KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}); close(CONF); } @@ -151,7 +154,16 @@ sub cmd_help { } write_irssi(undef, 'No such module'); } else { - write_irssi(undef, "Supported commands:\n save: Save the current configuration\n help [modulename]: Display this help, or module specific help\n show [modulename]: Show loaded modules, or the current parameters of a module\n set modulename parameter value: set a module parameter to a new value\n getter [modulename]: display or set the getter to use"); + 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 + set modulename parameter value: set a module parameter to a new value + getter [modulename]: display or set the getter to use + debug: enable debugging messages + nodebug: disable debugging messages +EOT } } @@ -228,7 +240,7 @@ sub init_videosite { my $p; - unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => ['module', 'key']))) { + unless(-r $conffile && defined($conf = XML::Simple::XMLin($conffile, ForceArray => ['config', 'option'], KeepRoot => 1, KeyAttr => {'config' => 'module', 'option' => 'key'}))) { # No config, start with an empty one write_debug(undef, 'No config found, using defaults'); $conf = { 'videosite' => { 'getter' => '' }};