I use curb gem to get some data from other website.
When I try
http = Curl.get("http://www.somesite.com/")
puts http.body_str
The data were
"{\"data\":[{\"id\":\"10000123456789\",\"name\":\"\\u1234\\u1234 \\u1234\\u1234\"},{\"id\":\"10000123465789\",\"name\":\"\\u1234\\u1234 \\u1234\\u1234\"},...}}}"
How to get data
or id
or name
?
반환된 데이터는 json 데이터이므로 Ruby의 json 모듈을 사용하여 처리하세요.
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/json/rdoc/JSON.html#method-i-parse