sub end : Private { my ( $self, $c ) = @_; my @posts = $c->model('DBIC::Post')->get_recent_posts(20); my $feed = XML::Feed->new($c->stash->{type}); $feed->title("Emo Sluts Porn Feed"); $feed->link($c->uri_for('/')); $feed->self_link('/'); $feed->description("Watch the hottest emo whores and sluts in porn at EmoWomen.com - New emo pussy and ass posted daily."); $feed->author("Keagan"); $feed->language('en-US'); foreach my $post (@posts) { my $entry = XML::Feed::Entry->new($c->stash->{type}); my $slug = $post->title; $slug =~ s/-/ /g; $entry->link($c->uri_for('/gallery/'.$slug)); $entry->title($post->title); $entry->content($post->body); $entry->issued($post->date->epoch); $entry->modified($post->date->epoch); my $url_part = $post->title; $url_part =~ s/ /-/g; $entry->link($c->req->base.'gallery/'.$url_part); $feed->add_entry($entry); } my $mime = ("Atom" eq $feed->format) ? "application/atom+xml" : "application/rss+xml"; $c->res->content_type($mime); $c->res->body($feed->as_xml); }