有没有办法只返回包含来自 FQL 流查询的照片的附件?

发布于 2024-12-10 03:44:37 字数 236 浏览 0 评论 0原文

我正在尝试使用 FQL 获取我的应用程序已发布到用户流的所有照片。我意识到我可以通过首先执行以下查询来做到这一点:

SELECT attachment FROM stream WHERE source_id = me() AND app_id = <my_app_id>

然后在本地解析附件以确定其类型。但我想知道,有没有办法在我的查询中包含附件类型,以便只返回带有照片的附件?

I am trying to get all the photos that my app has posted to a user's stream using FQL. I realize I could do this by first performing the following query:

SELECT attachment FROM stream WHERE source_id = me() AND app_id = <my_app_id>

and then parsing the attachments locally to determine their type. But I'm wondering, is there any way to include the attachment type in my query so that only attachments with photos are returned?

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

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

发布评论

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

评论(2

总攻大人 2024-12-17 03:44:37

Facebook 已更新流表以包含“类型”:

https://developers.facebook。 com/docs/reference/fql/stream/

The type of this story. Possible values are:

11 - Group created
12 - Event created
46 - Status update
56 - Post on wall from another user
66 - Note created
80 - Link posted
128 - Video posted
247 - Photos posted
237 - App story
272 - App story

所以我的问题的答案变成:

SELECT attachment FROM stream WHERE source_id = me() AND type = 247 AND app_id = <my_app_id> 

顺便说一句,他们似乎没有追溯更新流表,即旧帖子没有“类型”值

Facebook has updated the stream table to include "type":

https://developers.facebook.com/docs/reference/fql/stream/

The type of this story. Possible values are:

11 - Group created
12 - Event created
46 - Status update
56 - Post on wall from another user
66 - Note created
80 - Link posted
128 - Video posted
247 - Photos posted
237 - App story
272 - App story

So the answer to my question becomes:

SELECT attachment FROM stream WHERE source_id = me() AND type = 247 AND app_id = <my_app_id> 

By the way, it doesn't seem they retroactively updated the stream table i.e. old posts do not have a "type" value

⒈起吃苦の倖褔 2024-12-17 03:44:37

如果您尚未为发布到用户帐户的照片选择/创建特定相册,则所有照片都将位于同一个相册中 - 类似于 ;照片

摘自 Facebook 博客文章 489

...我们会自动为您的应用创建相册(如果尚未创建)
存在。以这种方式上传的所有照片都将添加到此相同的内容中
专辑。

从那里您可以检索您的应用程序发布的所有照片帖子。我发现用户不太可能将照片上传到您应用的特定相册中(尽管有可能)。

此外,将 photo_id/album_id 保存在您的自己的数据库中以供将来使用是一个好主意。

if you have not selected/created a specific album for photos being posted to a users account, all of them will be in the same album - something like <app_name> Photos.

Taken from facebook blog post 489 :

...We automatically create an album for your app if it does not already
exist. All photos uploaded this way will then be added to this same
album.

From there you could retrieve all photo posts made by your app. I find it very unlikely that a user would upload a photo into your app's specific album (although its possible)

In addition, saving photo_id/album_id in your own database for use in the future is a great idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文