如果这是一个非常愚蠢的问题,请原谅我,但是如何使用HTTParty从JSON get获取单个项呢?例如:
require 'rubygems'
require 'httparty'
require 'pp'
player = pp HTTParty.get('http://api.dribbble.com/players/1')
将返回以下内容:
{"name"=>"Dan Cederholm",
"avatar_url"=>
"http://dribbble.com/system/users/1/avatars/thumb/dancederholm-peek.jpg?1261060245",
"twitter_screen_name"=>"simplebits",
"shots_count"=>148,
"location"=>"Salem, MA",
"created_at"=>"2009/07/07 21:51:22 -0400",
"following_count"=>375,
"draftees_count"=>103,
"url"=>"http://dribbble.com/players/simplebits",
"id"=>1,
"followers_count"=>2119,
"drafted_by_player_id"=>nil}
我如何得到一个单独的项目,比如说,说名称?