|
|
||
lib/Plagger/Plugin/Publish/Pipe.pm
package Plagger::Plugin::Publish::Pipe; use strict; use base qw( Plagger::Plugin ); sub register { my($self, $context) = @_; $context->register_hook( $self, 'publish.feed' => \&feed, ); } sub feed { my($self, $context, $args) = @_; open my $out, "|" . $self->conf->{command} or $context->error("Can't open pipe: $!"); for my $entry ($args->{feed}->entries) { print $out $entry->title . "\n"; print $out $entry->permalink . "\n\n"; } close $out; } 1;
config.yaml
- module: Publish::Pipe config: command: /usr/bin/lpr # command: /usr/bin/wall # command: /usr/bin/fax # (for OSX users) command: /usr/bin/say
Example result