################################################################# # XMLization of Gossamer-Threads' Links 2.0 (non sql version) # ################################################################# 2001-05-05 by John Gotze - john@gotzespace.dk This mod will let you offer dynamically created RSS-feeds from single categories etc. Open search.cgi, save it as searchrss.cgi. This will be a new file, that you must upload and chmod 755. Edit searchrss.cgi as follows: Line 101: Change $category_results .= qq|
  • $linked_title\n|; to # $category_results .= qq|
  • $linked_title\n|; Line 116: Change $link_output{$setoflinks} .= &site_html_link (%tmp) . "\n"; to $link_output{$setoflinks} .= &site_html_rsslink (%tmp) . "\n"; Line 125: Change $link_results .= qq|

    $title_linked\n|; to # $link_results .= qq|

    $title_linked\n|; In your site_html_templates.pl Add this new subroutine, just after site_html_link sub site_html_rsslink { # -------------------------------------------------------- # This routine is used to display what a link should look # like in the lastlink.html webpage. my %rec = @_; # Set new and pop to either 1 or 0 for templates. ($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'}); ($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'}); return &load_template ('rsslink.html', { detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension", %rec, %globals }); } Add this new subroutine, just before sub site_html_mailing: sub site_html_search_rssresults { # -------------------------------------------------------- # This routine displays the search results. # my $term = &urlencode ($in{'query'}); &html_print_headers; print &load_template ('search_rssresults.html', { term => $term, link_results => $link_results, category_results => $category_results, next => $next, cat_hits => $cat_hits, link_hits => $link_hits, %in, %globals }); } Create two new templates named rsslink.html and search_rssresults.html. Upload to /templates, chmod 666. Template rsslink.html should look like this: <%Title%> <%URL%> <%Description%> (<%Date%>) Template search_rssresults.html should look like this: Yoursite stuff about <%term%> http://www.yoursite.com Yoursite Name en <%if link_results%> <%link_results%> <%endif%> That's it. Now you can get a number of different RSS-feeds: Use http://www.yoursite.com/searchrss.cgi?query=stuff to get a RSS-feed based on a query in your database. Use http://www.yoursite.com/searchrss.cgi?Category=ACategoryName/subcategory to get a RSS-feed with a category listing (change "ACategoryName/subcategory" to your category names) Use http://www.yoursite.com/searchrss.cgi?Category=ACategoryName/subcategory&isNew=Yes to get only the new links in a category Use http://www.yoursite.com/searchrss.cgi?isNew=Yes to get a RSS-feed with the most recently added links. etc. Note: Currently, the output is RSS 0.91. You can convert to RSS 1.0 by using: http://blogspace.com/rss/rss2rdf?url=http://www.yoursite.com/searchrss.cgi?isNew=Yes #