0
我已經運行在我的Rails應用程序如下:阿比結果怪誕
Flickr.collections_list
的類和方法是:
class Flickr
require 'httparty'
include HTTParty
API_KEY = '2fkjgdskjgksdjkgjrkbff3aee'
SECRET = '881fgregreg2b2'
USER_ID = '[email protected]'
RESPONSE_FORMAT = 'json'
base_uri 'http://api.flickr.com'
# Get list of all collections
def self.collections_list
response = get("/services/rest/",
:query => {
method: 'flickr.collections.getTree',
api_key: API_KEY,
user_id: USER_ID,
nojsoncallback: 1
}
)
JSON.parse(response.to_json.gsub('\"', '"'))
end
end
當運行在控制檯中我得到我的結果看起來不錯,但這只是一個結果,我只是得到一個分號。我不能放棄它,我不能看到API結果的其餘部分。這是怎麼回事?
=> {"rsp"=> {"collections"=> {"collection"=> {"collection"=> [{"collection"=> [{"set"=> [{"id"=>"7215fffff81735", "title"=>"Album title", "description"=>"Album title"}, {"id"=>"72145645ffff464564606", "title"=>"Album title", "description"=> "Album title"}, {"id"=>"721545646760", "title"=>"Album title", "description"=> "Album title"}], "id"=>"5794562-721546456457291", "title"=>"Album title", "description"=>"", "iconlarge"=>"/images/collection_default_l.gif", "iconsmall"=>"/images/collection_default_s.gif"}, {"set"=> [{"id"=>"72145645635562", "title"=>"Album title", "description"=>""}, {"id"=>"72164564561696", "title"=>"Album title", "description"=>""}, {"id"=>"72157464546", "title"=>"Album title", "description"=>""}, {"id"=>"72154564642", "title"=>"Album title", "description"=>""}, {"id"=>"7215762456456644", "title"=> "Album title", "description"=>""}, {"id"=>"721546456489442", "title"=>"Album title", "description"=>""}, {"id"=>"7215464568", "title"=> "Album title", "description"=>""}, {"id"=>"721574645638", "title"=>"Album title", :
我已經改變了所有的ID和專輯名稱中的代碼,但比它是響應的精確拷貝等。
任何人都可以幫忙嗎?