doushih06137 2012-03-06 20:23
浏览 20

没有表格的Facebook登录

How can I log into Facebook without a login form?

I've created an application which posts wall posts to one of my pages automatically (with a cron job).

But it needs login. I've done everything with the PHP SDK 3.1 and it works if I am logged into Facebook by my browser. But it does not work on my hosting and this is important for me because it is "scheduled auto poster".

Is it possible with the PHP SDK or JavaScript SDK or anything?

PS: Logging in with cURL does not work (code: http://www.daniweb.com/web-development/php/code/290893).

I use PHP SDK 3.1.

Here is my code:

 require 'sdk/facebook.php';
      $facebook = new Facebook(array(
      'appId'  => $bilgi_appID,
      'secret' => $bilgi_appSecret,
      'fileUpload' => true,
      'cookie' => true // enable optional cookie support
    ));
      $facebook->setFileUploadSupport(true);

$args = array(
    'message' => $bilgi_fotoMesaji,
    "access_token" => $access_token,
    "image" => $file
);

$data = $facebook->api('/'.$bilgi_sayfaninAlbumIDsi.'/photos', 'post', $args);
if ($data) 
    print_r("basariyla yuklendi...");

This works when I am logged in Facebook.

But how can I post a photo or post while I am logged out? It redirects login page.

  • 写回答

1条回答 默认 最新

  • doutany76678 2012-03-06 22:11
    关注

    Scheduled auto-posting is available when requesting the publish_stream permission, even when the user is actively using your application. From Permissions Reference:

    publish_stream
    Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. With this permission, you can publish content to a user's feed at any time. However, please note that Facebook recommends a user-initiated sharing model. Please read the Platform Policies to ensure you understand how to properly use this permission.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大