From 6e4d93d244b9240fde349888245495614c6c93fe Mon Sep 17 00:00:00 2001 From: kou Date: Tue, 5 Apr 2005 06:52:16 +0000 Subject: * sample/rss/tdiary_plugin/rss-recent.rb: new option: @options['rss-recent.use-image-link']: use image as link instread of text if available. * sample/rss/tdiary_plugin/rss-recent.rb (RSS_RECENT_VERSION): 0.0.5 -> 0.0.6. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/rss/tdiary_plugin/rss-recent.rb | 42 ++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'sample') diff --git a/sample/rss/tdiary_plugin/rss-recent.rb b/sample/rss/tdiary_plugin/rss-recent.rb index f0943838f..261ca872b 100644 --- a/sample/rss/tdiary_plugin/rss-recent.rb +++ b/sample/rss/tdiary_plugin/rss-recent.rb @@ -1,12 +1,16 @@ # -*- indent-tabs-mode: t -*- # rss-recent.rb: RSS recent plugin # +# options: +# @options['rss-recent.use-image-link'] : use image as link +# instead of text if available. +# # rss_recnet: show recnet list from RSS # parameters (default): # url: URL of RSS # max: max of list itmes(5) # cache_time: cache time(second) of RSS(60*60) -# +# # # Copyright (c) 2003-2005 Kouhei Sutou # Distributed under the GPL @@ -16,7 +20,7 @@ require "rss/rss" RSS_RECENT_FIELD_SEPARATOR = "\0" RSS_RECENT_ENTRY_SEPARATOR = "\1" -RSS_RECENT_VERSION = "0.0.5" +RSS_RECENT_VERSION = "0.0.6" RSS_RECENT_HTTP_HEADER = { "User-Agent" => "tDiary RSS recent plugin version #{RSS_RECENT_VERSION}. " << "Using RSS parser version is #{::RSS::VERSION}.", @@ -36,8 +40,8 @@ def rss_recent(url, max=5, cache_time=3600) site_info, *infos = rss_recent_read_from_cache(cache_file) if site_info - title, url, time = site_info - content = rss_recent_entry_to_html(title, url, time) + title, url, time, image = site_info + content = rss_recent_entry_to_html(title, url, time, image) rv << "
\n" rv << "#{content}\n" rv << "
\n" @@ -47,12 +51,12 @@ def rss_recent(url, max=5, cache_time=3600) rv << "