summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
authordmitry kim <jason@nichego.net>2009-01-27 16:27:10 +0300
committerdmitry kim <jason@nichego.net>2009-01-28 00:45:04 +0300
commit37f9fdca2fe1305febe801d169071e35d2ac3e91 (patch)
treec9b56a905cdd4d9b0048c998b0f59ee65dc74fe5 /data/rbot/plugins
parent4b0ee2583092fe221eed83f73055dfbcf691fde2 (diff)
* (rss.rb) bypass the http cache on !rss rewatch
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/rss.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index f80236f0..6d8d3c26 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -185,7 +185,7 @@ end
class ::RssBlob
attr_accessor :url, :handle, :type, :refresh_rate, :xml, :title, :items,
- :mutex, :watchers, :last_fetched
+ :mutex, :watchers, :last_fetched, :http_cache
def initialize(url,handle=nil,type=nil,watchers=[], xml=nil, lf = nil)
@url = url
@@ -197,6 +197,7 @@ class ::RssBlob
@type = type
@watchers=[]
@refresh_rate = nil
+ @http_cache = false
@xml = xml
@title = nil
@items = nil
@@ -836,6 +837,7 @@ class RSSFeedsPlugin < Plugin
if params and handle = params[:handle]
feed = @feeds.fetch(handle.downcase, nil)
if feed
+ feed.http_cache = false
@bot.timer.reschedule(@watch[feed.handle], (params[:delay] || 0).to_f)
m.okay if m
else
@@ -873,9 +875,10 @@ class RSSFeedsPlugin < Plugin
debug "fetching #{feed}"
first_run = !feed.last_fetched
oldxml = feed.xml ? feed.xml.dup : nil
- unless fetchRss(feed)
+ unless fetchRss(feed, nil, feed.http_cache)
failures += 1
else
+ feed.http_cache = true
if first_run
debug "first run for #{feed}, getting items"
parseRss(feed)