WordPress lets you choose to see only the entries with a specified tag from a blog, like, say, http://obvio171.wordpress.com/tag/soc. Thinking it would also have one feed per tag in the same way, I added that address to Planet-Soc as my soc feed.
To my great surprised, it crawled all of my posts and dumped it into the planet (sorry about that guys). I don’t know if they actually have a way to get one feed per tag, but I couldn’t find it, so I wrote the following:
#! /usr/bin/ruby
require 'rss'
rss = RSS::Parser.parse(open('http://obvio171.wordpress.com/feed/'))
channel = RSS::Rss::Channel.new
rss.channel.items.select {|i| !(i.categories.select {|c| c.content == "soc"}).empty?}.each {|i| channel.items << i}
channel.link = rss.channel.link
channel.title = rss.channel.title
channel.description = rss.channel.description
channel.generator = rss.channel.generator
rss.channel = channel
begin
File.delete('rss_soc.xml')
rescue
end
File.new('rss_soc.xml','w') << rss.to_xml
Now I only have to find a way to remove the old feed from planet-soc and add the new one (which btw is hosted at http://www.students.ic.unicamp.br/~ra033245/rss_soc.xml if anyone’s interested).