aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-08 04:49:53 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-08 04:49:53 +0000
commitd8314c24c2771d30ffc150798d140d52b4c28a14 (patch)
tree1798d28c71334de5a17551c2d64ba3332b101dda
parentAdd basic search utility. (diff)
downloadrbot-bugzilla-d8314c24c2771d30ffc150798d140d52b4c28a14.tar.gz
rbot-bugzilla-d8314c24c2771d30ffc150798d140d52b4c28a14.tar.bz2
rbot-bugzilla-d8314c24c2771d30ffc150798d140d52b4c28a14.zip
Convert announcements to use search.
-rw-r--r--bugzilla.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/bugzilla.rb b/bugzilla.rb
index 76380f9..e2c6c7e 100644
--- a/bugzilla.rb
+++ b/bugzilla.rb
@@ -393,16 +393,14 @@ class BugzillaPlugin < Plugin
def announce
return unless @registry["zilla.#{@name}.announcements"]
-
- recent_url = buglisturl
-
+ recent_url = nil
if lastseenid == nil
- recent_url += "&chfieldfrom=-6h&chfieldto=Now&chfield=%5BBug+creation%5D"
+ recent_url = "chfieldfrom=-6h&chfieldto=Now&chfield=%5BBug+creation%5D"
else
- recent_url += "&field0-0-0=bug_id&remaction=&type0-0-0=greaterthan&value0-0-0=#{lastseenid}"
+ recent_url = "field0-0-0=bug_id&remaction=&type0-0-0=greaterthan&value0-0-0=#{lastseenid}"
end
- buglist = CSV::Reader.create(@bot.httputil.get(recent_url)).to_a
+ buglist = search(recent_url)
buglist.delete_at(0)
upper_bound = [buglist.size, 5].min
buglist[-upper_bound..-1].each do |bug|
@@ -417,7 +415,7 @@ class BugzillaPlugin < Plugin
end
def search(urlparams, params = nil)
- url = buglisturl + urlparams
+ url = buglisturl + '&' + urlparams
searchdata = CSV::Reader.create(@bot.httputil.get(url)).to_a
return searchdata
end