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

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex