我正在使用图形 API 为页面创建许多事件,一次最多可达数百个。然而,每个事件都会在时间线上创建一个我不希望发生的帖子。
创建事件时有没有办法让它不显示在时间轴上?如果没有,我如何获得时间轴上帖子 ID 的引用?如果有帮助的话,我将添加每个事件的 ID 记录。
预先感谢您提供的所有帮助!
吉姆
最佳答案
我尝试将“no_feed_story”参数设置为 1,但它似乎不起作用(至少在沙盒模式下)。
我最终做的是进行另一个查询来获取页面提要,以查找提到事件创建的帖子的 ID,然后将其删除(需要publish_stream权限)
这是一个 php 示例(抱歉我不使用 asp.net):
// .. curl was configured and the event created just before this.
$newEventId = $result['id'];
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/$page/feed?access_token=$accessToken");
curl_setopt($ch, CURLOPT_POST, false);
$received_content = curl_exec($ch);
$result = json_decode($received_content, true);
foreach ($result['data'] as $feed)
{
if ($feed['link'] == "https://www.facebook.com/events/$newEventId/")
{
$postId = $feed['id'];
break;
}
}
if (isset($postId))
{
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/$postId?access_token=$accessToken");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
$received_content = curl_exec($ch);
$result = json_decode($received_content, true);
var_dump($result);
}
关于asp.net - 如何从时间线中隐藏使用 Graph API 创建的事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14249338/