- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Python 中使用 Facebook Graph API。每个帖子都有两个日期时间:
创建日期
更新日期
当我提供 since
参数时,它返回 created_date
大于或等于 since
参数的提要。例如,如果我提供 since=2015-06-05
那么它将返回从 2015 年 6 月 5 日到现在的所有帖子。
但假设有一个帖子是在 2015 年 6 月 7 日发布的,并且在 2015 年 6 月 8 日发生了一些事件(点赞、分享、评论等)。在这种情况下,updated_time
该帖子的内容发生了变化,但 created_time
将保持不变(2015 年 6 月 7 日)。如果我传递参数 since=2015-06-08
,那么我将无法跟踪该帖子的所有事件。
有什么解决方案可以让我在 updated_time
上传递 since
参数,而不是将它传递给 created_time
?
最佳答案
作为@CBroe points out in the comments ,这不受 Facebook Graph API 支持。 (以前使用 Facebook Query Language (FQL) 支持它,但现在不再可用)。
也就是说,通过一些创意(和一些额外的代码),可以通过组合几个查询来实现类似的效果。
在我的应用程序中,我使用以下参数执行查询:
until=2015-07-07
(或任何 since
日期)fields=updated_time
(以保持快速查询和小负载)limit=5000
(或一些类似的大页面大小,因为我只抓取一个字段)然后我评估每一个有 updated_time
的帖子大于可能的since
日期,并将这些帖子放入队列中以下载全部帖子内容。
例如,如果 until
(因此,since
)日期是2015-07-07
但是 updated_time
在个人帖子上是 2015-10-15
,然后我知道该帖子是在 2015-07-07
之前创建的但之后更新。它不会在 since
中被拾取查询,但我可以轻松地单独下载它以同步我的缓存。
Note: If you're dealing with content where there are frequent updates on past content, you'd likely want to use the Graph API's Batch Requests feature, as opposed to downloading each post individually.
关于使用 since updated_time 参数的 Facebook Graph API 搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30818119/
我写了一个sql来计算现在和上次更新时间之间的时间差异。首先,我只使用 CURRENT_TIMESTAMP - Updated_time 并发现结果在时间单位秒内看起来是正确的。但它并不稳定,有时结果
我正在编写一个应用程序来收集与特定搜索词匹配的 facebook 帖子,并且我试图仅获取自 graph.facebook.com/search 端点以来的新帖子或更新的帖子。我从调试中得出结论,这个特
我在 Python 中使用 Facebook Graph API。每个帖子都有两个日期时间: 创建日期 更新日期 当我提供 since 参数时,它返回 created_date 大于或等于 since
我是一名优秀的程序员,十分优秀!