IntroductionThis API is for http://tw.local.yahoo.com API details: http://tw.developer.yahoo.com/lifestyle_api.html
Example (Traditional Chinese)#!/usr/bin/env rubyAPPID = "NhYX9XjV34FPxdq7zD8T7wwc4QGI5VWu_48NHh03zbPYUfPpcWrpZzhcVDKFQsH9dQ--"require 'lifetype'require 'rexml/document'include REXML
puts "獲取生活+類別中... 請稍後"doc = Document.new(LifeType::Class.new(APPID).listClasses)puts "獲取類別結束"puts "類別總數: " + doc.get_elements("//rsp/ClassList")[0].attribute("count").to_sputs "列出類別中... 請稍後"doc.elements.each("//rsp/ClassList/Class") do |ele| puts "ID: #{ele.attributes["id"]} -- #{ele.get_elements("Title")[0].text}"endputs "列出類別結束"
没有任何数据可供显示