Custom Facebook comment box - facebook

I want to build custom Facebook comments box for that I have done lots of R&D but I am stuck on how will I post comments against the url of different pages of my website.
I want the similar functionality which Facebook's comment box plugin provides like I will drop my custom Facebook comments box on my page template and it will work for all the pages which are inheriting from that template. Which means each dynamic page will have its own commenting box depending on its url.
It would be better if anyone provide me steps to achieve this functionality. I have gone through the Facebook developers forum and have learn commenting against the ID of Objects but I want to start comment box from page Url as Facebook's comments box takes href of the page.
My test work:
When I have posted comments through Facebook comment box plugin against url and get all of them using Graph api so all comments are listing successfully.
but when I try to post the comments against the mentioned url using graph api so I get the exception here.
https://lh3.googleusercontent.com/-KckTuX8DifY/UOFP_e-5ayI/AAAAAAAAAJc/e1wYHZGN9Nc/s629/Get+and+Post+Comments.png
I need answers of following questions.
How will I start commenting against page's url.
My custom commenting box template are shown below
https://lh4.googleusercontent.com/-7iP0_Xi22zk/UOFOn_g_Q7I/AAAAAAAAAJI/FlnDhDTSyZs/s622/Custom+FB+comments+box.jpg
Thanks

Related

How can I populate initial content to a Facebook link (if I can)?

On my website, I just added links to discuss posts on Facebook; you can see such a link at http://jonathanscorner.com/steel/ . The link redirects to https://www.facebook.com/pages/CJS-Hayward/9506801167, which lets people post but is initially empty.
I would like, if possible, to create a link that prepopulates the text of the comment to include the title and URL on my site. So someone who clicked on that link would have a posting that is prepopulated, '''I just finished "Within the Steel Orb" at http://JonathansCorner.com/steel/. '''
Is there some URL parameter I can use ('''...?text=I%20just%20finished...''') or other interface to prepopulate a comment in a JavaScript-generated link?
Thanks,
Short answer, you can't. Even with the feed dialog you can't prepopulate the comment area with some pre-defined text. What you can do is, using the feed dialog making people write their comments, and the connection of that feed redirects to your website.
The only problem is that this feed dialog would appear on the users feed an not on your page wall.
Another way, and this is the best option in my opinion, add the comments social plugin to your site, this way people would discuss that article on your page and every time they comment using this social plugin, the comments would appear on their facebook wall making their friends curious about that and maybe visit your site.
You can read more about that here: https://developers.facebook.com/docs/reference/plugins/comments/

Is it possible to use Facebooks Comments Plugin with Graph Object IDs/Graph URLs rather than www URLs?

A little while ago, I built this:
http://www.littlebray.co.uk/photos.aspx
It's kind of an off-Facebook partial replica of a Facebook photo album gallery, the photos in the gallery section are all pulled from Facebook albums on the Page for Little Bray (fb.com/littlebray) enlarging them gives you a kinda full screen view of them with commenting facilties on the right margin, just like Facebook.
You'll notice that, whilst this comment section looks a bit like a Facebook plugin, it isn't, and the reason for this is that if I used Facebooks Comments Plugin, when a user comments on a photo on the website, or comments on the same photo (remembering the photos come from the same source), it will create two different streams of comments, one shown on FB and one shown on the website.
With my method, any comments posted either on the website or FB will appear in both places as they're al directly injected into the FB graph relating to the object ID of the photo.
A bit later on, I created another, similar image gallery but used Facebooks Social Plugin "Comments" in the right hand margin to comment on photos. The difference here though was that these photos were lcoally hosted by the website and not already Facebook album objects, so this other website is the only source for these images and thus creating FB objects when commenting via a URL is fine.
BUT... it got me thinking, is my first example just a lot of work, is it possible to use Facebooks own Social Plugin to post comments on an object which already exists on Facebook in that way?
I tried pasting a graph URL https://graph.facebook.com/FB_OBJECT_ID into the Comments example on Facebooks Social Plugins page from a status update of mine, but nothing showed.
Any ideas?
EDIT ---
I have discovered I am not alone in asking this question:
Using social plugins for pre-existing Facebook posts
Load comments from open graph object into Facebook comments social plugin
Neither of those have satisfactory answers though. Perhaps I just need to improve my own code and make my own plugin.
At this time the comments plugin can not be used in that way.

Load comments from open graph object into Facebook comments social plugin

I have created a website connected my facebook app. Users can login and post a custom action connected to a custom object with open graph, javascript sdk. This will also post with 'fb:explicitly_shared' set to true so it will generate a post on the users timeline. So these custom objects have their own url and on those pages i want to have the comment plugin. And i want that object page (with the comments plugin) and the post on the users timeline to share comments.
I have tried setting a lot of different things in the "href"-property on the comments plugin but nothing seems to work. However i have managed to get the comments of the timeline post with a call to '/objectid/comments' with FB.api(). I can use that to build my own comments ui, but i rather use the comments social plugin. Is there any way to make it happen?
The Post ID and the Open Graph Object ID are different, so I do not believe that they can share comments. Comments are based off a single Facebook ID. Also, it is not currently possible to write comments to an Open Graph Object from the API (comments plugin only) so you can't really create your own comments plugin for an OG object.

How do I get the most recent comments of Facebook?

So I have a comments box of Facebook on my site ( one on each article I have on my blog ). My client likes a widget with the most recent comments on his site. I found the Activity Feed with the note:
Activity is also displayed when users share content from your site in
Facebook or if they comment on a page on your site in the Comments
box.
I filled in the App ID, but it does not show the comments? Does anyone have an idea how I can get the most recent comments posted in the activity feed?
You should retrieve your comments by your URL, not by app ID.
The comments for every URL can be accessed via the graph API. Simply go to: https://graph.facebook.com/comments/?ids={YOUR_URL}.
For example, the comments on this URL can be accessed via: https://graph.facebook.com/comments/?ids=http://developers.facebook.com/docs/reference/plugins/comments.
Detailed information: How do I access the comments left on my site?
Some more about comment box: Adding new features to Comments Box

Facebook comments box with comments from multiple urls

I am looking at replacing the comments on my news site with a facebook comments box. This would mean that every time someone posts a news article people can comment on it. This would require many comment boxes for many urls.
On the front page of my site however, I have a feed to all the comments that are posted all over the page. This makes is useful for people to see the discussion happening around the site.
Is there a way to show all the comments that are being posted on my site in one location if I move to facebook comments?
Essentially it would be a feed of all the comments from the different urls.
For each url you have, you would need to occasionaly pull the comments down using the Facebook Graph Comments API with a URL like: https://graph.facebook.com/comments/?ids=http://developers.facebook.com/docs/reference/plugins/comments. You would then need to build something to display this. There are no social plugins built for this.