尝试熟悉sample Sinatra app的Instagram Ruby gem。问题是我找不到将参数应用于查询的正确方法,例如我试图将显示的帖子数量设置为 30 :
get "/user_recent_media" do
client = Instagram.client(:access_token => session[:access_token])
user = client.user
html =
"""
<h1 align=\"center\">#{user.username}</h1>
"""
for media_item in client.user_recent_media(self, options = {:count => 30})
html << "<img src='#{media_item.images.low_resolution.url}'>"
end
html
end
我尝试以这种方式应用参数,但它似乎没有起作用。