gpt4 book ai didi

facebook - Facebook Graph API-获取页面已创建的事件

转载 作者:行者123 更新时间:2023-11-30 23:56:26 26 4
gpt4 key购买 nike

如何获取页面创建的所有事件?

我尝试了以下方法:

https://graph.facebook.com/PAGEID/events


但是我没有任何数据回来。

有人能帮我吗?

最佳答案

我遇到了同样的问题,还更新了ivan.abragimovich提到的错误。

我不为此感到骄傲,但是这是我作为工作要做的事情。

$accessToken = "..."; // your OAuth token
$uid = "..."; // the id of the page you are using
$feed = $this->facebook->api("/$uid/feed", "GET", array('access_token' => $accessToken,
'limit' => 20));

// temp method of retrieving events until the page events bug is fixed.
// @see http://bugs.developers.facebook.com/show_bug.cgi?id=10399
if (array_key_exists('data', $feed) && is_array($feed['data']))
{
foreach($feed['data'] as $item)
{
if ($item['type'] == "link" && strpos($item['link'], "eid=") !== false)
{
preg_match('/eid=(\d+)/', $item['link'], $urlMatches);
if (count($urlMatches) == 2)
{
$eventId = $urlMatches[1];
$event = $this->facebook->api("/$eventId", 'GET', array('access_token' => $accessToken));
print_r($event);
}
}
}
}

关于facebook - Facebook Graph API-获取页面已创建的事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3129329/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com