2008-09-05 RSS 2.0 categories

This wiki produces a RSS feed that is aggregated by RPG Bloggers. They also auto-categorize entries. This requires the use of the RSS 2.0 category element.

RSS

RPG Bloggers

RSS 2.0 category element

Here’s what I added to my config.



sub NewRssItem {
  my $rss = OldRssItem(@_);
  my $id = shift;
  if ($OpenPageName eq $id) {
    my @categories;
    while ($Page{text} =~ m/\[\[tag:$FreeLinkPattern(\|.+?)?\]\]/og) {
      push(@categories, NormalToFree($1));
    }
    my $result = join("\n", map { "<category>$_</category>" } @categories);
    $rss =~ s|</item>|$result\n</item>|;
  }
  return $rss;
}

I’m not sure where to put this. Add it to Oddmuse:Indexed Search, Oddmuse:SearchTags Extension, Oddmuse:Blogging With Tags, or any of the other extensions that implement tags? Argh! Too. much. choice.

Oddmuse:Indexed Search

Oddmuse:SearchTags Extension

Oddmuse:Blogging With Tags

​#Oddmuse