检查用户是否将操作添加到时间轴

发布于 2024-12-19 16:54:49 字数 150 浏览 2 评论 0原文

我有一个包含文章的网站。当用户验证了应用程序并转到一篇文章时,它会在他们的个人资料/时间线上发布“X 已在 Z 上读取 Y”

这一切都很好,但如果他们回来几次,这种情况会发生几次,但我只想做一次。有什么想法吗?

如何检查用户是否已将某些内容添加到时间线?

I have a website with articles. When a user has authenticated an application and gone to an article, it posts that "X has read Y on Z" to their profile/timeline

This is all well and good but if they come back several times, this will happen several times but I just want it to be done once. Any ideas?

How do I check if a user has added something to the timeline already?

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

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

发布评论

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

评论(1

陈独秀 2024-12-26 16:54:49

通过自定义操作,您可以进入高级设置并使该操作唯一 - 这意味着它只能针对每个对象发布一次。

如果您尝试在同一对象上发布多个操作,则对 Graph API 的每个后续请求都将导致错误,并且不会存储任何操作。

内置 news.reads 操作已启用此属性。在《独立报》或《卫报》上,您只能“阅读”每篇文章一次。

目前无法通过 API 来查看用户是否拥有 .如果您想在不使用上述唯一性属性的情况下强制执行此操作,则需要将其存储在自己这边,并在发布到 Facebook 之前进行此检查。

With a custom action, you can go into the advanced setting and make the action unique - which means it can only be posted against each object once.

If you attempt to post multiple actions on the same object, each subsequent request to the Graph API will result in an error and no action will be stored.

The built-in news.reads action already has this property enabled. On The Independent or The Guardian, you can only 'read' each article once.

There is currently no way via the API to see if a user has an . If you want to enforce this without using the uniqueness property described above, you need to store this on your own side, and make this check before you post to Facebook.

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