gpt4 book ai didi

ruby-on-rails - Instagram client.tag_recent_media 零结果 #

转载 作者:数据小太阳 更新时间:2023-10-29 08:35:27 27 4
gpt4 key购买 nike

带有 devise+omniauth+instagram 的 Rails 应用

尝试搜索标签。

代码非常简单:

Instagram.configure do |config|
config.client_id = Rails.application.secrets.instagram[:key_id]
config.client_secret = Rails.application.secrets.instagram[:secret]
end

client = Instagram.client(access_token: "myaccesstoken")

client.tag("cat")
=> #<Hashie::Mash media_count=139391443 name="cat">

client.tag_recent_media("cat", count: 10)
=> #<Hashie::Array []>

虽然标签搜索告诉我有 139391443 个媒体带有标签“cat”,但我在查找它们时得到的结果为零。

标签搜索是否只搜索我用户的个人资料?还是用户提要?

我想像在 Twitter 中一样进行完整的公共(public)标签搜索。

最佳答案

您似乎遇到了 Instagram API 的限制 Sandbox Mode (也如 here 所述)。

上面链接的开发者文档明确指出:

As another example, let's consider an endpoint that returns a list of media: /tags/{tag-name}/media/recent. The response returned by this endpoint will contain only media with the given tag, as expected. But instead of returning media from any public Instagram user, it will return only media that belongs to your sandbox users, restricted to the last 20 for each user.

了解如何让您的应用获得 Instagram 批准 here .

关于ruby-on-rails - Instagram client.tag_recent_media 零结果 #<Hashie::Array []>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49326208/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com