Commit 45c469cd by vulehuan

limit 5 category

parent da8a08d5
......@@ -11,7 +11,11 @@ namespace :db do
xml_data = Net::HTTP.get_response(URI.parse(request_url)).body
# extract category information
doc = REXML::Document.new(xml_data)
i = 0
doc.elements.each('CategoryResult/Category/Item') do |ele|
i += 1
break if i > 5
id = ele.elements['Id'].text
title = ele.elements['Title'].text
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment