我目前正在尝试在使用 PHP(Codeigniter)执行脚本后将 url/status 发布到我的 facebook 页面。目前我收到以下错误uncaught oauthexception invalid oauth access token signature.
,我知道问题与我的访问令牌错误有关,但无论我在 Facebook 上阅读了多少文档,我似乎都无法弄清楚。有人可以给我一个关于如何获得访问令牌的解决方案吗?
include('system/libraries/facebook.php');
if($this->session->userdata('level') == "admin"){
$role = $this->input->post('role');
$company = $this->input->post('company');
$location = str_replace( '+', ' ', $this->input->post('location') );
$category = str_replace( '+', ' ', $this->input->post('category') );
$type = str_replace( '+', ' ', $this->input->post('type') );
$description = $this->input->post('description');
$extract = $this->input->post('extract');
$date = time();
$link = $this->input->post('link');
if($this->input->post('closing_date')){
$closing_date = $this->input->post('closing_date');
$closing_date = str_replace('/', '-', $closing_date);
$closing_date = strtotime($closing_date);
}else{
$closing_date = time() + 2592000;
}
$url = str_replace(' ', '-', trim($role));
$location_dash = str_replace(' ', '-', trim($location));
$url = $url."-in-".$location_dash;
$this->db->set('role', $role);
$this->db->set('company', $company);
$this->db->set('type', $type);
$this->db->set('location', $location);
$this->db->set('category', $category);
$this->db->set('url', strtolower($url));
$this->db->set('description', $description);
$this->db->set('extract', $extract);
$this->db->set('link', $link);
$this->db->set('time', $date);
$this->db->set('closing_date', $closing_date);
$this->db->set('active', 1);
$this->db->insert('jobs');
$job = $this->db->get_where('jobs', array('time' => $date ))->row_array();
$url = "http://www.example.com/job/view/".$job['id']."/".$job['url']."";
$facebook = new Facebook(array(
'appId' => '***',
'secret' => '***'
));
$message = array(
'access_token' => "***",
'message'=> "".$url.""
);
$facebook->api('/me/accounts','POST', $message);