programmatically login to facebook and post to page (wall)

后端 未结 3 2398
长情又很酷
长情又很酷 2021-02-10 21:17

I have a website, and I need it to post status updates to a Facebook Page from time to time.

Using my personal Facebook account, I created an App, and a Page. So far, I\

3条回答
  •  心在旅途
    2021-02-10 22:08

    This is what I use to do,

     // = SET WALL DATA HERE ===============
    $attachment = array(
    'access_token' => 'My Access token here',
    'message'      => '',
    'name'         => 'My Wall Post Header/Title Here',
    'caption'      => 'Small caption here',
    'link'         => 'http://www.mywebsite.org',
    'description'  => 'Wall Post Details Here',
    'picture'      => "http://www.mywebsite.org/images/logo.gif",
    );
    
    // =POST ON FACEBOOK WALL ==========================
    $this->facebook->api('/me/feed', 'POST', $attachment);
    , $attachment);
    

    So include your Facebook API, Get your Facebook Access token, SET data for your wall post and call for facebook api with me/feed method.

    This will make a wall post on your wall without asking for login.

    make sure you are using correct Access Token.

提交回复
热议问题