aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-05 19:44:44 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-05 19:44:44 +0000
commit6191670bc01dd6f407fe6e15262fe22b900cb661 (patch)
treed5bade66175934cc4a2b73aee8af9bed0e718434
parentConvert glsa to using httputil. (diff)
downloadrbot-gentoo-6191670bc01dd6f407fe6e15262fe22b900cb661.tar.gz
rbot-gentoo-6191670bc01dd6f407fe6e15262fe22b900cb661.tar.bz2
rbot-gentoo-6191670bc01dd6f407fe6e15262fe22b900cb661.zip
Convert herd to httputil.
-rw-r--r--gentoo-data.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/gentoo-data.rb b/gentoo-data.rb
index 244dc14..7bb53b5 100644
--- a/gentoo-data.rb
+++ b/gentoo-data.rb
@@ -62,10 +62,8 @@ class GentooPlugin < Plugin
def herd(m, params)
# TODO: Add in caching
# TODO: Add in not-a-herd.txt
- res = Net::HTTP.start('www.gentoo.org', 80) { |http|
- http.get('/proj/en/metastructure/herds/herds.xml?passthru=1')
- }
- herds = REXML::Document.new(res.body)
+ res = @bot.httputil.get("http://www.gentoo.org/proj/en/metastructure/herds/herds.xml?passthru=1")
+ herds = REXML::Document.new(res)
herd = herds.get_elements("/herds/herd[name='#{params[:herd]}']")
if herd.empty?
m.reply "#{response_prefix(m)}Unable to find herd '#{params[:herd]}'"