def render_rss_table(url, max_count = 5)
require 'rss'
@content = ""
rss = RSS::Parser.parse(url, false)
if rss && rss.channel && rss.channel.title
@content += "
\n"
@content += " \n"
@content += "
\n"
rss.items.each_with_index do |i, count|
break if count == max_count && max_count != 0
@content += " \n"
@content += " #{i.title} | \n"
@content += " #{i.date.strftime("%Y/%m/%d")} | \n"
@content += "
\n"
end
@content += " もっと読む... |
\n" if max_count != 0
@content += "
\n"
@content += "
"
end
return @content
end
def render_rss_sidebarlist(url, max_count = 7)
require 'rss'
@content = ""
rss = RSS::Parser.parse(url, false)
if rss && rss.channel && rss.channel.title
@content += " \n"
@content += " \n"
@content += "
\n"
rss.items.each_with_index do |i, count|
break if count == max_count && max_count != 0
@content += " - #{i.title}
\n"
end
@content += " - もっと読む...
\n" if max_count != 0
@content += "
\n"
@content += "
"
end
return @content
end