File: makerss_comment.rb

package info (click to toggle)
tdiary-contrib 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,772 kB
  • sloc: ruby: 17,305; javascript: 8,263; lisp: 562; xml: 451; php: 61; sql: 40; makefile: 18
file content (35 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# makerss_comment.rb: extension for makerss plugin.
#
# Copyright (C) 2007 by SHIBATA Hiroshi <h-sbt@nifty.com>
# Distributed under GPL2.
#

class MakeRssComments < MakeRssFull
	def title
		'(comments only)'
	end

	def item( seq, body, rdfsec )
		return if rdfsec.section.respond_to?( :body_to_html )
		super
	end

	def file
		f = @conf['makerss.no_comments.file'] || 'comments.rdf'
		f = 'comments.rdf' if f.length == 0
		f =~ %r|^/| ? f : "#{document_root}/#{f}"
	end

	def write( encoder )
		super( encoder )
	end

	def url
		u = @conf['makerss.no_comments.url'] || "#{@conf.base_url}comments.rdf"
		u = "#{@conf.base_url}comments.rdf" if u.length == 0
		u
	end
end

@makerss_rsses << MakeRssComments::new( @conf, @cgi )