]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/tube.rb
Initial implementation of proper caching based on last-modified and etag HTTP headers
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / tube.rb
index 853167184533ffe8330f701850ac15cb6704870f..0a9feb2f0198dcb67c8f2245f3889c4dea471110 100644 (file)
@@ -13,7 +13,7 @@ class TubePlugin < Plugin
   def tube(m, params)
     line = params[:line]
   begin
-    tube_page = @bot.httputil.get(URI.parse("http://www.tfl.gov.uk/tfl/service_rt_tube.shtml"), 1, 1)
+    tube_page = @bot.httputil.get_cached(URI.parse("http://www.tfl.gov.uk/tfl/service_rt_tube.shtml"), 1, 1)
   rescue URI::InvalidURIError, URI::BadURIError => e
     m.reply "Cannot contact Tube Service Status page"
     return
@@ -42,7 +42,7 @@ class TubePlugin < Plugin
 
   def check_stations(m, params)
     begin
-      tube_page = @bot.httputil.get(URI.parse("http://www.tfl.gov.uk/tfl/service_rt_tube.shtml"))
+      tube_page = @bot.httputil.get_cached(URI.parse("http://www.tfl.gov.uk/tfl/service_rt_tube.shtml"))
     rescue URI::InvalidURIError, URI::BadURIError => e
       m.reply "Cannot contact Tube Service Status page"
       return