【问题标题】:Why does Facebook return null end_time for event?为什么 Facebook 为事件返回 null end_time?
【发布时间】:2012-09-05 03:06:55
【问题描述】:

当我使用 fql 查询 Facebook 的 256996217750754 eid 时,它返回 end_time 为 null:

SELECT eid, name, pic_small, pic_big, pic_square, pic, host, description, start_time, end_time, creator, update_time, location, venue, privacy from event where eid=256996217750754

返回:

...
"start_time": "2012-09-01T22:00:00-0400",
"end_time": null,
...

但是,当我查询图表时,它返回准确:

https://graph.facebook.com/256996217750754?access_token=<access_token>

返回:

...
start_time: "2012-09-01T22:00:00",
end_time: "2012-09-02T01:00:00",
...

有人知道为什么吗?

【问题讨论】:

    标签: facebook facebook-graph-api facebook-fql


    【解决方案1】:

    当事件没有定义可选的结束时间时,end_time 为 null。 此外,当我查询该事件的图表时,我没有看到与 FQL 返回 null 一致的 end_time

    {
       "id": "256996217750754",
       "owner": {
          "name": "Buffalo Wings & Rings Morrisville, NC",
          "category": "Restaurant/cafe",
          "id": "136674116345739"
       },
       "name": "UFC 151 on Pay Per View - Jones vs. Henderson",
       "description": "Main Card -\nJones vs Henderson\nJohnson vs Castillo\nMizugaki vs Hougland\nSiver vs Yagin\nLineker vs Urushitani\nPrelims - \nCruickshank vs Martinez\nRoller vs Volkmann",
       "start_time": "2012-09-01T22:00:00-0400",
       "timezone": "America/New_York",
       "location": "Buffalo Wings & Rings Morrisville, NC",
       "venue": {
          "id": "136674116345739"
       },
       "privacy": "OPEN",
       "updated_time": "2012-08-02T14:37:21+0000"
    }
    

    我用过:

    https://graph.facebook.com/256996217750754?access_token=AAACEdEose...
    

    【讨论】:

      【解决方案2】:

      我相信 Donn Lee 部分正确。根据 Facebook 开发人员article 的说法,“end_time”始终是为事件定义的。不过,这将在 2012 年 10 月 30 日之前消失。

      请注意 Donn Lee 对图表的响应与我自己的不同。

      我的回复,禁用了“事件时区”:

      ...
      "start_time": "2012-09-01T22:00:00-0400",
      "end_time": null,
      ...
      

      Donn Lee 的回复,可能启用了“Events Timezone”:

      ...
      "start_time": "2012-09-01T22:00:00-0400",
      ...
      

      可以在 Facebook 应用程序“高级”设置页面的“迁移”下找到此设置:

      结论

      看来我需要迁移我的代码以支持 Facebook 的 new event time conventions

      1. 处理 ISO-8601 带偏移
      2. 如果未指定“end_time”,则不期望。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-12-26
        • 2011-04-12
        • 2016-12-28
        • 2015-11-25
        • 2015-07-04
        • 2019-09-29
        • 2015-02-25
        • 2015-10-21
        相关资源
        最近更新 更多