Sorry

This feed does not validate.

Source: http://blogstrapping.com/rss.rhtml

  1. <%
  2. path = File.dirname(__FILE__)
  3. $:.unshift path + '/lib'
  4. require 'bluecloth'
  5. require 'time'
  6. require 'yaml'
  7.  
  8. channel_description = String.new(
  9.  "Blogstrapping is Chad Perrin's development blog, focusing on Lump development, software design, and the philosophy of programming."
  10. )
  11.  
  12. channel_date = Time.now.gmtime.rfc2822.sub('-', '+')
  13.  
  14. puts '<?xml version="1.0" encoding="iso-8859-1"?>'
  15. puts '<rss version="2.0">'
  16. puts '<channel>'
  17. puts
  18.  
  19.  
  20. puts '  <title>blogstrapping</title>'
  21. puts '  <link>http://blogstrapping.com</link>'
  22. puts "  <description>#{channel_description}</description>"
  23. puts "  <lastBuildDate>#{channel_date}</lastBuildDate>"
  24. puts "  <language>en-us</language>"
  25. puts
  26.  
  27.  
  28. config = YAML.load_file(path + '/lump.conf')
  29. content_path = "#{path}/#{config['body']['content_dir'].to_s}"
  30.  
  31. content_listing = Dir.entries(content_path).select do |f|
  32.  f.match /.*\.txt$/
  33. end
  34.  
  35. content_listing.sort.reverse.each do |entry_page|
  36.  entry_id = entry_page.sub('.txt', '')
  37.  
  38.  entry_date = Time.gm( entry_id ).gmtime.rfc2822.sub('-','+')
  39.  
  40.  entry_description = BlueCloth.new(
  41.    File.open("#{content_path}/#{entry_page}").read
  42.  ).to_html
  43.  
  44.  puts '  <item>'
  45.  print '    <title>'
  46.  
  47.  File.open("#{content_path}/#{entry_page}", 'r') do |c|
  48.    print c.readline.sub(/^#+\s+/, '').chomp
  49.  end
  50.  
  51.  puts '</title>'
  52.  puts "    <link>http://blogstrapping.com/?page=#{entry_id}</link>"
  53.  puts "    <guid>http://blogstrapping.com/?page=#{entry_id}</guid>"
  54.  puts "    <pubDate>#{entry_date}</pubDate>"
  55.  puts "    <description>#{entry_description}</description>"
  56.  puts '  </item>'
  57.  puts
  58. end
  59.  
  60.  
  61. puts '</channel>'
  62. print '</rss>'%>
  63.  
Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda