如何在不点击php中的按钮的情况下在facebook页面上发布
在过去的2-3天里,我的应用程序在facebook上发布,没有用户交互,但现在,我不知道为什么,这不起作用 这是我的密码:如何在不点击php中的按钮的情况下在facebook页面上发布,php,facebook,facebook-graph-api,Php,Facebook,Facebook Graph Api,在过去的2-3天里,我的应用程序在facebook上发布,没有用户交互,但现在,我不知道为什么,这不起作用 这是我的密码: function post_fb($fb_text) { echo file_get_contents("https://graph.facebook.com/me/feed?access_token="."***".$fb_text); $ch = curl_init(); $data = array('message' => $fb_
function post_fb($fb_text) {
echo file_get_contents("https://graph.facebook.com/me/feed?access_token="."***".$fb_text);
$ch = curl_init();
$data = array('message' => $fb_text, 'access_token' => "***");
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/me/feed');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$tuData = curl_exec($ch);
if(!curl_errno($ch)){
return true;
/*$info = curl_getinfo($ch);
print_r($info);
echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];*/
}
/*else {
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
echo $tuData;*/
}
你能给我们一些代码来使用吗?请给出你尝试过的代码。请这是我每次都在尝试的代码,我不知道我是如何生成访问令牌的