require 'rubygems'
require 'open-uri'
require 'rexml/document'
class GetAtnd
def initialize(id = "hoge")
@id = id
end
def get_user_uri #REXML::Documentオブジェクトの取得メソッド
atnd_api_page = "http://api.atnd.org/events/users/?event_id=#{@id}/"
source = open(atnd_api_page)
@user = REXML::Document.new source
end
def user_each
@user.elements.each('hash/events/event/users/user/nickname'){|f|
puts f.text
}
end
def get_info_uri #REXML::Documentオブジェクトの取得メソッド
atnd_api_page = "http://api.atnd.org/events/?event_id=#{@id}/"
source = open(atnd_api_page)
@info = REXML::Document.new source
end
def event_title
@info.elements.each('hash/events/event/title'){|f|
puts f.text
}
end
end
hoge = GetAtnd.new(イベント番号)
hoge.get_user_uri
hoge.user_each
hoge.get_info_uri
hoge.event_title
#あとこれをつかってアプリケーション開発するやる気がほしい