views:

42

answers:

1

Hi there, I'd like to add a comment box on my facebook fan page.

So I added on my StaticFBML page:

<fb:comments xid="159887744022306">
<fb:title>Leave a comment</fb:title>
</fb:comments>

Where "159887744022306" is my page ID. Now it actually posts comments on the page but:

  • The feature "Post comment to my Facebook profile" doesn't work. Why?
  • How can I control what they share (e.g. adding a picture inside their post) ?

Thanks

A: 

In reference to the Graph API found here

You should use the Feed API

https://graph.facebook.com/me/feed?access_token=&lt;auth_token&gt; (for your feed) or https://graph.facebook.com/&lt;USER ID>/feed?access_token=<auth_token>

The feed api accepts the following variables (found here) message, picture, link, name, caption, description, source

of which are to be passed via HTTP POST

Also, note that if you don't pass any parameters to the Feed API call, then it will not set the feed to anything but instead return JSON for yours or another users recent posts.

These api calls can be made via the JavaScript SDK or a PHP SDK. If you are not sure how to set up Graph API to work on your site then I recommend reading, all about the Graph API before trying to implement it as it can be a bit intimidating at first.

KennyCason
I'm not sure you got me. I'm inside a Facebook fan page, StaticFBML. Not an external website nor an FB app. Is that still valid?
Leonardo Dario Perna
And if you got me right can you please show me an example for the <fb:comments> code above? thanks.
Leonardo Dario Perna

related questions