Skip to main content

How do you post to the wall on a facebook page (not profile)


I have a blog site written in php and it posts new blog posts to twitter and a blog ping automatically under the hood using simple http post requests passed using php curl.



I have a facebook page for the blog site and want the updates to be posted to the wall on the page, is there a simple way to do this?



What I really want is a url and set of params to parcel up as an http post request.



Note that this is to post to the wall on a new style page not a profile.



Thanks in advance.


Source: Tips4allCCNA FINAL EXAM

Comments

  1. <?php
    $attachment = array(
    'message' => 'this is my message',
    'name' => 'This is my demo Facebook application!',
    'caption' => "Caption of the Post",
    'link' => 'http://mylink.com',
    'description' => 'this is a description',
    'picture' => 'http://mysite.com/pic.gif',
    'actions' => array(
    array(
    'name' => 'Get Search',
    'link' => 'http://www.google.com'
    )
    )
    );


    $result = $facebook->api('/me/feed/', 'post', $attachment);


    the above code will Post the message on to your wall... and if you want to post onto your friends or others wall then replace me with the Facebook User Id of that user..for further information look out the API Documentation.

    ReplyDelete
  2. Harish has the answer here - except you need to request manage_pages permission when authenticating and then using the page-id instead of me when posting....

    $result = $facebook->api('page-id/feed/','post',$attachment);

    ReplyDelete
  3. You can not post to Facebook walls automatically without creating an application and using the templated feed publisher as Frank pointed out.

    The only thing you can do is use the 'share' widgets that they provide, which require user interaction.

    ReplyDelete
  4. This work to me:

    try {
    $statusUpdate = $facebook->api('/me/feed', 'post',
    array('name'=>'My APP on Facebook','message'=> 'I am here working',
    'privacy'=> array('value'=>'CUSTOM','friends'=>'SELF'),
    'description'=>'testing my description',
    'picture'=>'https://fbcdn-photos-a.akamaihd.net/mypicture.gif',
    'caption'=>'apps.facebook.com/myapp','link'=>'http://apps.facebook.com/myapp'));
    } catch (FacebookApiException $e) {
    d($e);
    }

    ReplyDelete
  5. If you're blog outputs an rss feed you can use Facebook's "RSS Graffiti" application to post that feed to your wall in FB. There are other RSS facebook apps as well just search facebook for rss apps...

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?