可以有人告诉我"如何"或"什么是"'id'参数,用于在红宝石instagram api方法 location(id), location_recent_media(id,options{}), media_item(id), media_likes(id) 等等给出院文件 http://rubydoc.info/github/Instagram/instagram-ruby-gem ?我使用的轨道和api安装使用的宝石。

有帮助吗?

解决方案

你可以看到一个如何使用API在这里 https://github.com/Instagram/instagram-ruby-gem,看看码我要说的是id是依赖什么样的查询,如果您使用的位置(id)将它的标识位置。现在,为了获得从"真实世界"的位置,我相信你可以使用location_search(经度、纬度),这会给你一个列有所有地点接近坐标,e。g(从代码文件):

Instagram.location_search("37.7808851", "-122.3948632")

会给你一个阵地周围37.7808851,-122.3948632(164S园,SF,CA美国)。

然后你就可以使用这一系列标识的位置(id),e。g:

mylocations = Instagram.location_search("37.7808851", "-122.3948632")
Instagram.location(mylocations.first)

希望这有所帮助。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top