Commit | Line | Data |
12a0f9d3 |
1 | package Gitalist::Controller::OPML; |
2 | |
3 | use Moose; |
4 | use Moose::Autobox; |
f539912a |
5 | use DateTime; |
12a0f9d3 |
6 | use Sys::Hostname qw/hostname/; |
7 | use XML::OPML::SimpleGen; |
8 | |
9 | use namespace::autoclean; |
10 | |
11 | BEGIN { extends 'Gitalist::Controller' } |
12 | |
8f419e38 |
13 | sub opml : Chained('/base') Args(0) { |
12a0f9d3 |
14 | my ($self, $c) = @_; |
15 | |
16 | my $opml = XML::OPML::SimpleGen->new(); |
17 | |
f539912a |
18 | $c->stash( |
19 | title => lc(hostname()) . ' - ' . blessed($c)->config->{name}, |
20 | Repositories => $c->model()->repositories, |
21 | now => DateTime->now, |
22 | template => 'opml.tt2', |
23 | no_wrapper => 1, |
24 | ); |
12a0f9d3 |
25 | |
12a0f9d3 |
26 | $c->response->content_type('application/rss'); |
27 | } |
28 | |
29 | __PACKAGE__->meta->make_immutable; |