通过图形api(URL)将照片上传到Facebook

时间:2017-07-21 07:22:52

标签: php wordpress facebook facebook-graph-api

我用wordpress制作了照片网站4年来我用facebook图api从我的网站上传照片到facebook,它需要图片的网址并通过网址上传,现在因为facebook已经将图形api更改为2.10我的应用程序不再工作,我使用2.3,我不是开发人员,我所做的一切都来自谷歌搜索,现在我不知道如何使它再次工作,在这里检查我的网站 http://www.punjabidharti.com/pd/english-fonts/ 现在当我点击上传到fb buttonit show page isnt woking ..

这是我的索引文件

try {
    $access_token=$facebook->getAccessToken();
    $graph_url= "https://graph.facebook.com/me/photos?"
  . "url=" . urlencode($_POST["source"])
  . "&message=" . urlencode($_POST['message'])
  . "&method=POST"
  . "&access_token=" .$access_token;
    $response=file_get_contents($graph_url);
    $json=json_decode($response);
  }
  catch (FacebookApiException $e) {
    error_log('Could not post image to Facebook.');
  }
}

Base_facebook.php

public function getType() {
    if (isset($this->result['error'])) {
        $error = $this->result['error'];
        if (is_string($error)) {
            // OAuth 2.0 Draft 10 style
            return $error;
        } else if (is_array($error)) {
            // OAuth 2.0 Draft 00 style
            if (isset($error['type'])) {
                return $error['type'];
            }
        }
    }

我正在使用这些文件 https://github.com/facebookarchive/facebook-php-sdk/tree/master/src

如果您需要其他文件,请告诉我, 提前致谢

0 个答案:

没有答案
相关问题