2010-06-27 56 views

回答

0

您确定有事件与页面关联吗?您可能需要检查是否可以检索Feed。只需将“事件”与网址中的“Feed”互换即可。

+0

我从页面创建了一个事件,所以我想它会被关联? 当我将其更改为“feed”时,我收到一些数据 – Mikkel 2010-06-28 06:27:47

+0

您是否检查过该事件与该页面关联而不是您的帐户?将ID更改为您的ID并查看它是否存在。 – 2010-06-28 10:24:45

+0

它应该与页面相关联,主要是因为当我去页面上的“Events”页面上显示事件。我试图使用我的ID,结果是一样的:没有 – Mikkel 2010-06-28 10:47:07

1

我跑到相同的问题,也更新了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); 
      } 
     } 
    } 
}