[Catalyst] CatalystSites.org

Paul Makepeace paulm at paulm.com
Fri Apr 11 12:41:56 BST 2008


On Fri, Apr 11, 2008 at 12:08 PM, Kieren Diment <diment at gmail.com> wrote:
>
>  On 11 Apr 2008, at 20:35, Dan Dascalescu wrote:
>
> >
> > >
> > > > http://www.catalystsites.org/
> > > >
> > >
> >
> >
> > > Thanks, this looks useful, and can probably replace the sites running
> > > catalyst pages on the wiki.
> > >
> >
> > That would be a great idea. I've been editing
> > http://catwiki.toeat.com/meta/tracpagestoport/liveapplications lately
> > and I was surprised to see only Kieren's mention of it here (and no
> > mention of http://www.catalystsites.org there).
> > 1) Stephen, feel free to grab the links from catwiki and move them to
> > catalystsites.org
> > 2) Is the wiki still the intended repository for documentation? I
> > found that scarcely any new content got added over the last few weeks.
> >
> >
>
>  Oops, sorry :-º
>
>  I think the priority for catalystsites.org should be for rss support - one
> rss feed on the root should be sufficient initially.  I didn't see an
> announce to the list, so I assume that there's still no public svn repos,
> although I've noticed that *someone* has been fixing the code.
>
>  Once rss support is done I would strongly recommend that catalystsites.org
> becomes  the official site for sites running catalyst
>
>  Here's a moderately naive rss implementation, but apparently it's one of
> the few more reliable parts of wiab:
>
>  sub rss : Local {
>     my ($self, $c)= @_;
>     my $path = $c->req->args;
>     my $base = Path::Class::Dir->new($c->config->{content});
>     my $rss_data = $c->model('Content')->get_rss_data($base, $path);
>
>     # this is view code which is in the controller really.  It could
>     # be in the model, but then we would have to mess around with
>     # ACCEPT_CONTEXT or uglier.
>     my $feed = XML::Feed->new('RSS');
>     if (@$path) {
>         my $subpage = join '/', @$path;
>         $feed->title( $c->config->{name} . ' for ' . $subpage  .' page RSS
> Feed' );
>     }
>     else {
>     $feed->title( $c->config->{name} . ' RSS Feed' );
>     }
>
>     $feed->link( $c->uri_for("/content/") );
>     $feed->description( $c->config->{site_descr} );
>     foreach my $entry ( @$rss_data ) {
>         my $feed_entry = XML::Feed::Entry->new('RSS');
>         $feed_entry->title( $entry->{title} );
>         $feed_entry->link( $c->uri_for("/content/" . $entry->{link}));
>         $feed_entry->summary($entry->{summary});
>         $feed_entry->issued( DateTime->from_epoch(epoch   =>
> $entry->{issued} ) );
>         $feed->add_entry($feed_entry);
>     }
>     $c->res->content_type('application/rss+xml');
>     $c->res->body( $feed->as_xml );
>
>
>  }

I'm curious, is there a compelling reason you're using one of the
nine(!) RSS "standards" versus Atom?

sub atom : Path('atom.xml') {
  my ($self, $c) = @_;

  my @tags = $c->req->param('tags');
  my @news : Stashed = $c->model('DBIC::Story')->tagged_news(\@tags);

  my $feed = XML::Feed->new('Atom');
  $feed->title('Our Org Atom Feed');
  $feed->link($c->req->base); # link to the site.
  $feed->description("Our Org presents @tags news");

  foreach my $entry (@news) {
    my $feed_entry = XML::Feed::Entry->new('Atom');
    $feed_entry->title($entry->headline);
    $feed_entry->link($c->uri_for($entry->hyperlink));
    $feed_entry->content($entry->body_text);
    $feed_entry->category($_->tag) for $entry->tags;
    #$feed_entry->author($entry->...author...);
    $feed_entry->issued($entry->date_time);
    $feed->add_entry($feed_entry);
  }
  $c->res->content_type('application/atom+xml');
  $c->res->body($feed->as_xml);
}

P

>
>
>  _______________________________________________
>  List: Catalyst at lists.scsys.co.uk
>  Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>  Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>  Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list