source: server/trunk/web/lib/Sophie/Model/Rss.pm @ 173

Last change on this file since 173 was 173, checked in by nanardon, 13 years ago
  • add /feed section (RSS feeds)
File size: 1.3 KB
Line 
1package Sophie::Model::Rss;
2use Moose;
3use namespace::autoclean;
4use POSIX qw(strftime);
5
6extends 'Catalyst::Model';
7extends 'XML::RSS';
8
9=head1 NAME
10
11Sophie::Model::Rss - Catalyst Model
12
13=head1 DESCRIPTION
14
15Catalyst Model.
16
17=cut
18
19sub new {
20    my ($class) = @_;
21
22    bless({}, $class);
23}
24
25sub ACCEPT_CONTEXT {
26    my ($self, $c, %options) = @_;
27
28    my $new =  bless(XML::RSS->new(version => '2.0'), __PACKAGE__);
29    $new->channel(
30        title          => 'Sophie rpms girafe',
31        link           => $c->uri_for('/'),
32        language       => 'en',
33        description    => "Sophie's Feed",
34        rating
35            => '(PICS-1.1 "http://www.classify.org/safesurf/" 1 r (SS~~000 1))',
36        copyright      => 'Copyright 2010, Nanar',
37        pubDate        => strftime('%a, %d  %b  %Y %H:%M:%S %z', gmtime()),
38        lastBuildDate  => strftime('%a, %d  %b  %Y %H:%M:%S %z', gmtime()),
39        docs           => 'http://sophie.zarb.org/trac',
40        managingEditor => 'nanardon@nanardon.zarb.org',
41        webMaster      => 'nanardon@nanardon.zarb.org',
42    );
43
44    return $new;
45}
46
47=head1 AUTHOR
48
49Olivier Thauvin
50
51=head1 LICENSE
52
53This library is free software. You can redistribute it and/or modify
54it under the same terms as Perl itself.
55
56=cut
57
58__PACKAGE__->meta->make_immutable(inline_constructor => 0);
59
601;
Note: See TracBrowser for help on using the repository browser.