Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Category RSS Feeds...

Quote Reply
Category RSS Feeds...
I want to set up RSS feeds for each of my directory categories, New Links area, etc. so people can subscribe to a particular category to monitor newly added links.

Does anyone have a step-by-step on how to do this or is there a plug-in or global to accomplish this?

Thanks a lot.

Quote Reply
Re: [mgeyman] Category RSS Feeds... In reply to
I'm personally using the PageBuilder plugin to create such feeds, but if you are not picky about everything, you can just use the old XML-plugin, and specify search string with catid=NN for category feeds, isNew=Yes for a feed with new links. etc.
Quote Reply
Re: [mgeyman] Category RSS Feeds... In reply to
You can do it with a global - this is for the new links in a category:

sub {
my $id=shift;
my $cattable=$DB->table('Links','CatLinks');
$cattable->select_options('ORDER BY Add_Date DESC','LIMIT 10');
my $sth = $cattable->select({CategoryID=>$id},VIEWABLE);
my @loop;
while (my $hit = $sth->fetchrow_hashref()) {
push @loop, $hit;
return {Links_Loop=>\@loop};

This is another global for general info about the category (optional I think):

sub {
my $id=shift;
my $table = $DB->table('Category');
my $link = $table->select({ID=>$id})->fetchrow_hashref;
return {%$link};

Then a new template something like this (please feel free to make comments on this as I'm not an rss expert)

<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
<%set pubdate=$Links_Loop.0.Add_Date~%>
<title>New Sites in <%Name%> on <%site_title%></title>
<description>This is a feed of the latest listings in <%Name%> on <%site_title%></description>
<pubDate><%GT::Date::date_transform($pubdate,"%yyyy%-%mm%-%dd%","%ddd%, %dd% %mmm% %yyyy% %hh%:%MM%:%ss% GMT")%></pubDate>
<description>Description of your site</description>
<%loop Links_Loop%>
<title><%escape_html Title%></title>
<description><%escape_html Description%></description>
<guid isPermaLink="true">http://www.link.to.detailed.page</guid>
<pubDate><%GT::Date::date_transform($Add_Date,"%yyyy%-%mm%-%dd%","%ddd%, %dd% %mmm% %yyyy% %hh%:%MM%:%ss% GMT")%></pubDate>