unless sibling_types.member? "text/plain"
  case content_type
  when "text/html"
    `/usr/bin/w3m -dump -T #{content_type} '#{filename}'`
  when "text/calendar"
    summary = "No summary"
    dtstart = "No start time"
    dtend = "No end time"
    location = "No location"
    event = false

    File.open(filename) do |f|
      f.each do |line|
	case line
	when /^BEGIN:VEVENT/
	  event = true
	when /^END:VEVENT/
	  event = false
	when /^SUMMARY[^:]*:(.*)/
	  if event
	     summary = $1
	  end
	when /^LOCATION[^:]*:(.*)/
	  if event
	     location = $1
	  end
	when /^DTSTART[^:]*:(.*)/
	  if event
	    dtstart = DateTime.strptime($1, '%Y%m%dT%H%M%S').ctime
	  end
	when /^DTEND[^:]*:(.*)/
	  if event
	    dtend = DateTime.strptime($1, '%Y%m%dT%H%M%S').ctime
	  end
	end
      end
    end

    "Summary:  #{summary}\n" +
    "Start:    #{dtstart}\n" +
    "End:      #{dtend}\n"   +
    "Location: #{location}\n"
  end
end
