如何获取“id”来自 Instagram api 的参数?
有人可以告诉我“如何获取”或“什么是”ruby instagram api 方法中使用的“id”参数 location(id)、location_recent_media(id,options{})、media_item(id)、 media_likes(id)
等在院子文档中给出 http://rubydoc.info/github/Instagram/instagram-ruby-gem ?我使用的是 Rails,API 是使用 gem 安装的。
Can someone tell me "how to get" or "what is" the 'id' parameter that is used in the ruby instagram api methods location(id), location_recent_media(id,options{}), media_item(id), media_likes(id)
etc given in the yard documentation http://rubydoc.info/github/Instagram/instagram-ruby-gem ? I am using rails and the api is installed using gem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在此处查看如何使用 API 的示例 https://github.com/Instagram/ instagram-ruby-gem,看一下代码,我会说 id 取决于您正在查询的内容,如果您使用 location(id) ,它将是该位置的 id。 id,我相信您可以使用 location_search(longitude, latitude) ,这将为您提供一个包含所有靠近该坐标的位置的数组,例如(来自代码文档):
现在,要从“现实世界”位置获取该 会给你一个数组,位置在 37.7808851, -122.3948632 (164 S Park, SF, CA USA) 附近。
然后您可以将 id 数组与 location(id) 一起使用,例如:
希望有帮助。
You can see an example of how to use the API in here https://github.com/Instagram/instagram-ruby-gem, taking a look at the code I would say that the id is dependent on what you are querying, if you are using location(id) it would be the id of the location. Now, to get from a "real world" location to that id I believe you can use location_search(longitude, latitude) and that would give you an array with all the locations close to that coordinates, e.g (from the code documentation):
That would give you an array with the locations around 37.7808851, -122.3948632 (164 S Park, SF, CA USA).
Then you can use that array of ids with location(id), e.g:
Hope it helps.