Facebook API:从事件中获取位置/地点 ID

发布于 2024-11-02 20:49:14 字数 119 浏览 1 评论 0原文

如果我通过 Graph API 访问某个事件,我只能获取该位置的名称,但在 Facebook 网站上,它会链接到具有唯一 ID 的位置。我可以通过 API 访问此 ID 还是需要自己解析此 ID。

此致 安迪

if I access to an event via the Graph API I only get the name of the location but on the facebook site it is linked to a location with an unique ID. Can I get access to this ID via the API or it is necessary to parse this ID myself.

Best regards
Andy

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

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

发布评论

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

评论(2

人心善变 2024-11-09 20:49:14

在我看来,“场地”信息仅在某些场地返回。我仍在尝试确定为什么有些出现而另一些不出现 - 我最初的想法是它必须是“官方”地址或类似地址。例如,此活动有“场地”信息:

https://graph.facebook.com/147330072002695

但你的不:

https://graph.facebook.com/216169778395404

It looks to me like the "venue" info is only returned on certain venues. I'm still trying to determine why some show up and others don't - my initial thought is that it has to be an "official" address or some such. For example this event has "venue" info:

https://graph.facebook.com/147330072002695

But yours doesn't:

https://graph.facebook.com/216169778395404

黎歌 2024-11-09 20:49:14

获得活动后,您可以搜索具有纬度和经度坐标的地点,然后选择该位置(如果该位置在列表中)。

以下是使用 Branches FB API 的示例:

Dim FB As New SessionInfo("[access_token]")
Dim Req = New Functions.Requests(FB)
Dim EV = Req.GetEvent("331218348435")
'Search the co-ordinates returned
Dim PL = Req.GetCheckInsNearMe(" ", EV.venue.latitude, EV.venue.longitude, 25)
For Each P In PL
    If P.name = ev.location then
        'Location Found
         MyPlaceID = P.id
    end if
Next

Once you get your event you can search for the place with the lat and long co-ordinates and then pick the location if it is in the list.

Here's an example using the Branches FB API:

Dim FB As New SessionInfo("[access_token]")
Dim Req = New Functions.Requests(FB)
Dim EV = Req.GetEvent("331218348435")
'Search the co-ordinates returned
Dim PL = Req.GetCheckInsNearMe(" ", EV.venue.latitude, EV.venue.longitude, 25)
For Each P In PL
    If P.name = ev.location then
        'Location Found
         MyPlaceID = P.id
    end if
Next
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文