diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-22 06:14:48 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-22 06:14:48 +0000 |
commit | 422b69f919a8219ce7a72b8ce7101b49a48c5454 (patch) | |
tree | 4e8e61a483f3ec0cc4975e017d8c29118e722743 | |
parent | d5c9cfd09d5ceff8b490597f5f8ebf219479fbc1 (diff) | |
download | ruby-422b69f919a8219ce7a72b8ce7101b49a48c5454.tar.gz ruby-422b69f919a8219ce7a72b8ce7101b49a48c5454.tar.xz ruby-422b69f919a8219ce7a72b8ce7101b49a48c5454.zip |
* lib/rss/rss.rb: moved copyright description to lib/rss.rb.
* lib/rss.rb: added for convenience.
* sample/rss/re_read.rb: added #to_s sample.
* sample/rss/blend.rb: use 'require "rss"' instead of 'require "rss/*"'.
* sample/rss/list_description.rb: ditto.
* sample/rss/rss_recent.rb: ditto.
* sample/rss/tdiary-plugin/rss-recent.rb: ditto.
* sample/rss/tdiary-plugin/rss-recent.rb: 0.0.6 -> 0.0.7.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | lib/rss/rss.rb | 7 | ||||
-rwxr-xr-x | sample/rss/blend.rb | 5 | ||||
-rw-r--r-- | sample/rss/list_description.rb | 4 | ||||
-rw-r--r-- | sample/rss/rss_recent.rb | 4 | ||||
-rw-r--r-- | sample/rss/tdiary_plugin/rss-recent.rb | 18 |
6 files changed, 23 insertions, 31 deletions
@@ -1,3 +1,19 @@ +Fri Jul 22 15:02:39 2005 Kouhei Sutou <kou@cozmixng.org> + + * lib/rss/rss.rb: moved copyright description to lib/rss.rb. + + * lib/rss.rb: added for convenience. + + * sample/rss/re_read.rb: added #to_s sample. + + * sample/rss/blend.rb: use 'require "rss"' instead of + 'require "rss/*"'. + * sample/rss/list_description.rb: ditto. + * sample/rss/rss_recent.rb: ditto. + * sample/rss/tdiary-plugin/rss-recent.rb: ditto. + + * sample/rss/tdiary-plugin/rss-recent.rb: 0.0.6 -> 0.0.7. + Fri Jul 22 14:37:43 2005 Kouhei Sutou <kou@cozmixng.org> * lib/rss/parser.rb (RSS::Parser#initialize): accept HTTP/FTP diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index e5f116ef4..c200f8956 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -1,10 +1,3 @@ -# Copyright (c) 2003-2004 Kouhei Sutou. You can redistribute it and/or -# modify it under the same terms as Ruby. -# -# Author:: Kouhei Sutou <kou@cozmixng.org> -# Tutorial:: http://www.cozmixng.org/~rwiki/?cmd=view;name=RSS+Parser%3A%3ATutorial.en - - require "time" class Time diff --git a/sample/rss/blend.rb b/sample/rss/blend.rb index 2aa30d7fc..e578f26a8 100755 --- a/sample/rss/blend.rb +++ b/sample/rss/blend.rb @@ -1,9 +1,6 @@ #!/usr/bin/env ruby -require "rss/1.0" -require "rss/2.0" -require "rss/dublincore" -require "rss/maker" +require "rss" feeds = [] verbose = false diff --git a/sample/rss/list_description.rb b/sample/rss/list_description.rb index ac1db099c..bb1f9636e 100644 --- a/sample/rss/list_description.rb +++ b/sample/rss/list_description.rb @@ -10,9 +10,7 @@ class String end end -require "rss/1.0" -require "rss/2.0" -require "rss/dublincore" +require "rss" channels = {} verbose = false diff --git a/sample/rss/rss_recent.rb b/sample/rss/rss_recent.rb index 70776c1e8..7821df5c7 100644 --- a/sample/rss/rss_recent.rb +++ b/sample/rss/rss_recent.rb @@ -10,9 +10,7 @@ class String end end -require "rss/1.0" -require "rss/2.0" -require "rss/dublincore" +require "rss" items = [] verbose = false diff --git a/sample/rss/tdiary_plugin/rss-recent.rb b/sample/rss/tdiary_plugin/rss-recent.rb index 7e6aad55e..867851f38 100644 --- a/sample/rss/tdiary_plugin/rss-recent.rb +++ b/sample/rss/tdiary_plugin/rss-recent.rb @@ -20,7 +20,7 @@ require "rss/rss" RSS_RECENT_FIELD_SEPARATOR = "\0" RSS_RECENT_ENTRY_SEPARATOR = "\1" -RSS_RECENT_VERSION = "0.0.6" +RSS_RECENT_VERSION = "0.0.7" RSS_RECENT_HTTP_HEADER = { "User-Agent" => "tDiary RSS recent plugin version #{RSS_RECENT_VERSION}. " << "Using RSS parser version is #{::RSS::VERSION}.", @@ -49,12 +49,12 @@ def rss_recent(url, max=5, cache_time=3600) have_entry = infos.size > 0 && max > 0 - rv << "<ul>\n" if have_entry + rv << "<ul class='rss-recent'>\n" if have_entry i = 0 infos.each do |title, url, time, image| break if i >= max next if title.nil? - rv << '<li>' + rv << "<li class='rss-recent-item'>" rv << %Q[<span class="#{rss_recent_modified_class(time)}">] rv << rss_recent_entry_to_html(title, url, time, image) rv << %Q[</span>] @@ -78,17 +78,7 @@ def rss_recent_cache_rss(url, cache_file, cache_time) if cached_time.nil? or Time.now > cached_time + cache_time require 'time' - require 'open-uri' - require 'net/http' - require 'uri/generic' - require 'rss/parser' - require 'rss/1.0' - require 'rss/2.0' - require 'rss/dublincore' - begin - require 'rss/image' - rescue LoadError - end + require 'rss' begin uri = URI.parse(url) |