From 43ac960aa89e5a02291fe875627dac88ae7fda34 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 24 Oct 2006 15:24:13 +0000 Subject: Initial implementation of proper caching based on last-modified and etag HTTP headers --- data/rbot/plugins/slashdot.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/rbot/plugins/slashdot.rb') diff --git a/data/rbot/plugins/slashdot.rb b/data/rbot/plugins/slashdot.rb index 30f58dc9..ef96a4b0 100644 --- a/data/rbot/plugins/slashdot.rb +++ b/data/rbot/plugins/slashdot.rb @@ -12,7 +12,7 @@ class SlashdotPlugin < Plugin search = params[:search].to_s begin - xml = @bot.httputil.get(URI.parse("http://slashdot.org/search.pl?content_type=rss&query=#{URI.escape(search)}")) + xml = @bot.httputil.get_cached(URI.parse("http://slashdot.org/search.pl?content_type=rss&query=#{URI.escape(search)}")) rescue URI::InvalidURIError, URI::BadURIError => e m.reply "illegal search string #{search}" return @@ -53,7 +53,7 @@ class SlashdotPlugin < Plugin debug params.inspect max = params[:limit].to_i debug "max is #{max}" - xml = @bot.httputil.get(URI.parse("http://slashdot.org/slashdot.xml")) + xml = @bot.httputil.get_cached(URI.parse("http://slashdot.org/slashdot.xml")) unless xml m.reply "slashdot news parse failed" return -- cgit v1.2.3