1 | package Sophie::Model::Rss; |
---|
2 | use Moose; |
---|
3 | use namespace::autoclean; |
---|
4 | use POSIX qw(strftime); |
---|
5 | |
---|
6 | extends 'Catalyst::Model'; |
---|
7 | extends 'XML::RSS'; |
---|
8 | |
---|
9 | =head1 NAME |
---|
10 | |
---|
11 | Sophie::Model::Rss - Catalyst Model |
---|
12 | |
---|
13 | =head1 DESCRIPTION |
---|
14 | |
---|
15 | Catalyst Model. |
---|
16 | |
---|
17 | =cut |
---|
18 | |
---|
19 | sub new { |
---|
20 | my ($class) = @_; |
---|
21 | |
---|
22 | bless({}, $class); |
---|
23 | } |
---|
24 | |
---|
25 | sub 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 | |
---|
49 | Olivier Thauvin |
---|
50 | |
---|
51 | =head1 LICENSE |
---|
52 | |
---|
53 | This library is free software. You can redistribute it and/or modify |
---|
54 | it under the same terms as Perl itself. |
---|
55 | |
---|
56 | =cut |
---|
57 | |
---|
58 | __PACKAGE__->meta->make_immutable(inline_constructor => 0); |
---|
59 | |
---|
60 | 1; |
---|