# licensed under GNU GPL v2
#
# Based on youtube.pl by Christian Garbs <mitch@cgarbs.de>
+# which in turn is
+# based on trigger.pl by Wouter Coekaerts <wouter@coekaerts.be>
use strict;
use Irssi 20020324 qw (command_bind command_runsub signal_add_first signal_add_last);
$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');
}
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);
}
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' => '' }};