从facebook php-sdk删除帖子

时间:2010-09-19 16:42:23

标签: api facebook

是否可以使用facebook的php sdk删除帖子? 我一直在尝试各种各样的事情但是我得到了这个错误:

Fatal error: Uncaught OAuthException: (#200) This post wasn't created by the application thrown in C:\xampp\htdocs\auth\facebook.php on line 523

我的代码:

<?php

require "facebook.php";

$facebook = new Facebook(array(
    "appId" => "<appId>",
    "secret" => "<secret>",
    "cookie" => 1
));

if ($facebook->getSession())
{
    echo "<a href='" . $facebook->getLogoutUrl() . "'>Logout</a>"; 
    $user = $facebook->api("/me/feed?access_token=" . $facebook->getAccessToken());
    $facebook->api("/" . $user["data"][0]["id"] . "?access_token=" . $facebook->getAccessToken(), "DELETE");
}
else
{
    $loginUrl = $facebook->getLoginUrl();
    echo "<a href='$loginUrl'>Login</a>";
}

&GT;

或者有什么问题吗?

0 个答案:

没有答案