我试图n
在符号键的末尾打印并标记它,每次n
递增;那可能吗?
这是代码部分...
# User info
client = Instagram.client(:access_token => session[:access_token])
@user = Hash.new
@user[:info] = client.user
# User media
@user[:recent_media] = Hash.new
@user[:recent_media][:p1] = client.user_recent_media
# user_recent_media only ever retrieves in 20 out of x image links; x being total profile images
(1..9).each do |n|
page_max_id = @user[:recent_media][:p<n>].pagination.next_max_id
return if page_max_id.nil?
@user[:recent_media][:p<n+1>] = client.user_recent_media(max_id: page_max_id)
end