#!/usr/bin/env /Users/afragen/Applications/squib/trunk/script/runner # run from terminal # cd ~/Applications/squib/trunk/script; ruby export2rss.rb > ~/Desktop/rssExport.xml # Created by Andy Fragen (and Matt Mower) on 2007-05-18. require "environment" require "rubygems" require "builder" require "time" builder = Builder::XmlMarkup.new xml = builder.rss( :version => "2.0" ) do |xml| xml.channel do |xml| xml.title "Surgical Diversions" xml.link "http://www.thefragens.com/blog/" xml.description "my time out of the operating room" xml.copyright "Andy Fragen" xml.generator "Squib" xml.managingEditor "andy@thefragens.com" xml.webMaster "andy@thefragens.com" xml.language "en" Entry.find(:all).each do |entry| xml.item do |item| xml.title entry.title xml.link entry.permalink xml.pubDate entry.when_published.rfc822 xml.description entry.content xml.guid entry.permalink, :isPermaLink => true end end end end puts xml