Plagger::Plugin::Notify::Browser
Update Entryをブラウザで開きます。タブブラウザ万歳プラグイン
Notify::Ejectをコピペ多し。
Plagger::Plugin::Notify::Browser
package Plagger::Plugin::Notify::Browser;
use strict;
use base qw( Plagger::Plugin );
sub init {
my $self = shift;
$self->SUPER::init(@_);
my $class = 'Plagger::Plugin::Notify::Browser::' . lc($^O);
eval "require $class;";
if ($@) {
Plagger->context->error("Browser plugin doesn't run on your platform $^O");
}
bless $self, $class;
}
sub register {
my($self, $context) = @_;
$context->register_hook(
$self,
'publish.entry' => \&entry,
);
}
sub entry {
my($self, $context, $args) = @_;
$self->open($args->{entry}->link);
}
1;
Mac OS X用
Plagger::Plugin::Notify::Browser::darwin
package Plagger::Plugin::Notify::Browser::darwin;
use base qw( Plagger::Plugin::Notify::Browser );
use strict;
sub open {
my ($self, $link) = @_;
system 'open', $link;
}
1;
Windows用
Plagger::Plugin::Notify::Browser::mswin32
package Plagger::Plugin::Notify::Browser::mswin32;
use base qw( Plagger::Plugin::Notify::Browser );
use strict;
sub open {
my ($self, $link) = @_;
system 'start', $link;
}
1;
Linux(Firefox)未確認です
package Plagger::Plugin::Notify::Browser::linux;
use base qw( Plagger::Plugin::Notify::Eject );
use strict;
sub open {
my ($self, $link) = @_;
system 'firefox', '-new-tab', $link;
}
1;
シイラだと同じタブにページが開いてしまう。