/usr/share/perl5/Perlanet/Simple.pm is in libperlanet-perl 0.56-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | package Perlanet::Simple;
use strict;
use warnings;
use Moose;
use namespace::autoclean;
use Carp;
use YAML 'LoadFile';
extends 'Perlanet';
with qw(
Perlanet::Trait::Cache
Perlanet::Trait::OPML
Perlanet::Trait::Scrubber
Perlanet::Trait::Tidy
Perlanet::Trait::YAMLConfig
Perlanet::Trait::TemplateToolkit
Perlanet::Trait::FeedFile
);
=head1 NAME
Perlanet::Simple - a DWIM Perlanet
=head1 SYNOPSIS
my $perlanet = Perlanet::Simple->new_with_config('perlanet.yaml')
$perlanet->run;
=head1 DESCRIPTION
L<Perlanet> provides the driving force behind all Perlanet applications,
but it doesn't do a whole lot, which means you would normally have to write
the functionality you require. However, in the motive of simplicity,
Perlanet::Simple glues enough stuff together to allow you to get a very quick
planet working out of the box.
Perlanet::Simple takes the standard Perlanet module, and adds support for
caching, OPML feed generation, and L<Template> rendering support. It will
also attempt to clean each post using both L<HTML::Scrubber> and L<HTML::Tidy>.
=head2 Configuration
Perlanet::Simple uses L<Perlanet::Trait::YAMLConfig> to allow you to specify
configuration through a file.
=cut
around '_build_ua' => sub {
my $orig = shift;
my $self = shift;
my $ua = $self->$orig;
$ua->agent($self->agent) if $self->agent;
return $ua;
};
=head2 clean_html
Some custom cleaning code to remove a nasty piece of BlogSpot HTML
(and still running all other cleaning traits)
=cut
around clean_html => sub {
my $orig = shift;
my ($self, $html) = @_;
# hack to remove a particularly nasty piece of blogspot HTML
$html = $self->$orig($html);
$html =~ s|<div align="justify"></div>||g;
return $html;
};
1;
|