Plagger/Plugin/Filter/2chNewsokuTitle.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 25 CC 3 SCAR 19.5
CC
3
Cov
0%
update
12.0
register
2.0
BEGIN
2.0
CRAP 7.0
1 package Plagger::Plugin::Filter::2chNewsokuTitle;
2 use strict;
3 use base qw( Plagger::Plugin );
4  
5 sub register {
6 my($self, $context) = @_;
7 $context->register_hook(
8 $self,
9 'update.entry.fixup' => \&update,
10 );
11 }
12  
13 sub update {
14 my($self, $context, $args) = @_;
15  
16 my $tags = $args->{entry}->tags;
17 my $title = $args->{entry}->title;
18 $title = "\x{3010}$tags->[0]\x{3011} " . $title if $tags->[0];
19 $title = $title . " \x{3010}$tags->[1]\x{3011}" if $tags->[1];
20  
21 $args->{entry}->title($title);
22 }
23  
24 1;
25  
26 __END__