使用 FQL 查找所有要搜索的标签都在照片中的照片的最佳方法是什么?

发布于 2024-12-27 16:04:02 字数 483 浏览 5 评论 0原文

如果我想使用 FQL 搜索照片中包含 2 个人的照片,我可以使用以下代码来执行此操作 -

$fql_query_url = 'https://graph.facebook.com/' . '/fql?q=SELECT+src_big+FROM+photo+WHERE+pid+IN(SELECT+pid+FROM+photo_tag+WHERE+subject+IN('.$tag_list.'))' . '&access_token=' . $params['access_token'];   

其中 $tag_list 变量是逗号分隔的用户 ID 列表。

这将返回在照片中标记了这些用户的照片。

但是,如果我想查找照片中两个人都出现(被标记)的照片该怎么办?有没有好的方法可以做到这一点?如果我想找到照片中一大群人怎么办?最好只是迭代结果并在结果返回后检查所有用户是否都在照片中?

还有其他人解决过这个问题吗? 非常感谢

If I want to use FQL to search for photos where 2 people are in the photos I can do this using the following code -

$fql_query_url = 'https://graph.facebook.com/' . '/fql?q=SELECT+src_big+FROM+photo+WHERE+pid+IN(SELECT+pid+FROM+photo_tag+WHERE+subject+IN('.$tag_list.'))' . '&access_token=' . $params['access_token'];   

Where the $tag_list variable is a comma separated list of user ids.

This returns the photos where either of those users are tagged in the photo.

However what if I want to find photos where BOTH of the people appear (are tagged) in the photos. Is there a good way to do this? What if I want to find a large group of people in the photos. Is it best just to iterate over the results and check that all users are in the photos once the result is returned?

anyone else tackled this?
many thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过潦 2025-01-03 16:04:02
fql?q=
SELECT src_big 
  FROM photo 
 WHERE pid IN (SELECT pid FROM photo_tag WHERE subject ='{uid1}') 
   AND pid IN (SELECT pid FROM photo_tag WHERE subject ='{uid2}')
fql?q=
SELECT src_big 
  FROM photo 
 WHERE pid IN (SELECT pid FROM photo_tag WHERE subject ='{uid1}') 
   AND pid IN (SELECT pid FROM photo_tag WHERE subject ='{uid2}')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文