Get consolidated facebook comments from plugins via API - as in moderation tool - facebook

We have a comments plugin on many of our website pages and would like to be able to retrieve all of the posted comments on the entire site and be able to filter them by the page on which they were posted as the comments are page specific.
All of the comments can be accessed via the url https://developers.facebook.com/tools/comments?id={APP_ID} but I need to be able to access this list via the API.
I realise that we can get the comments when we have the url of the page or the object_id of the plugin. The problem is finding all of the object_ids/urls that we have associated on our site in order to use these comment searching methods.
Other than maintaining a list of all urls that we know have the plugin present, is there any way of dynamically maintaining this list through the api?
All pages have the same associated app_id and are in the same domain.

Related

Why the number of comment in Facebook plugin is different from number of comment in Facebook API?

The question is as what the title stated. For example:
Social Plugin
There are only 2 comments in the Facebook plugin for that link.
Facebook API
The Facebook API says that there are 47 comments. What is the cause of the different? My thought is that the social plugin only counts the number of comment via the plugin, while the Facebook API one counts all the comments including the social plugin and any comment on the link in the Facebook. Am I wrong?
Check out data from Graph API.
It returns precise data, comment count for a Url, which is commented by a social plugin.
You, on the other hand, are accessing data from table link_stat, which is used for, as per offcial documentation
An FQL table containing counts that show how users on Facebook are interacting with a given link.
In the end, I agree with you, you get all activity for that link on the whole FB.

Adding facebook comments to my website object

Is there any way I can create comments related to my object, without using the comments plugin? The Facebook Graph API seems like the correct way, but can I link to an object on my web site without actually "posting" that object as a post on facebook? Amazingly, I can't find anyone on the Net with this problem, so perhaps I'm simply doing it wrong.
I'm trying to post to:
https://graph.facebook.com/comments/?ids=http://iesgroup.ca/myappbeta/Item/1799633&message=test&access_token....
I do have the publish_stream permission in the access_token. All I get back is "An unknown error has occurred".
Essentially, I have set up my own web site using the Open Graph protocols. Each item that I have has its own URL with the proper OG tags. For each item, I am able to fetch the comments that facebook has associated with it. But I am unable to actually attach new comments to that object, without using the facebook comment plugin. I'm using my own look-and-feel commenting system, so I am not interested in using facebook's module. I'm using the JavaScript API to fetch the existing comments.
Note, that if I use the Open Graph protocol, users are able to post actions to their timeline, but not actually associate new comments to the object.
Thoughts? Thanks.
The only way I know of is to use the Facebook Graph API and have a Facebook website application and use server-side code to directly re-post comments from your website to the facebook page on an existing Facebook object. It is much more in-depth than the simple Open Graph implementation. But if you don't want to use Facebook's comment module, I don't see any other option. This is a link to the area of making comments, http://developers.facebook.com/docs/reference/api/Comment/ , but this is only useful after you have everything else set up. This is a huge undertaking to get your website to this point, but you will have full control over every aspect of how you interact with Facebook, cause you write your own code. Here is a link to the top level of the FB Graph API so you can read more about it. http://developers.facebook.com/docs/reference/api/
Nick - www.meltedjoystick.com

How do I query links shared by Facebook Pages?

I can get a user's page/likes list using the graph /me/likes. But how can I return a list of links shared by these Pages?
For example, let's say a user likes the Facebook Platform Page. I can pull this id (19292868552) using the /me/likes graph api. But how can I pull the links that the Facebook Platform Page has shared on their page?
For a regular user you would do something like this:
Sample FQL:
SELECT link_id, title, summary, url FROM link WHERE owner IN (19292868552);
But for Facebook Pages (like the above Facebook Platform Page example), this returns null. But the actual Facebook Platform Page shows dozens of links (at least). How can I get the links shared by these pages?
You can test it here:
FQL Query Test Console
I'm a little late to the party here, but I thought I'd post my gist example here. fbconsole makes it fairly simple to extract data through the Facebook Graph API to address this issue.
The caveat is that it was not terribly easy to programmatically extract data through fbconsole so I wrote the fbconsole.automatically_authenticate to make it much easier to access this information in a systematic way. This addition has not yet been incorporated into the master branch of fbconsole (it was just posted this morning), but it is available here in the meantime for those that are interested.

Programmatically posting Facebook comments

My application has obtained publish_stream permissions for a Facebook user.
I'd like to allow the user to post comments for a target URL directly from my mobile application, rather than opening up an embedded browser that then shows the Comment Box plugin. That is, the user doesn't necessarily want to post the link to their feed -- rather they want to participate in any Facebook comment discussion that surrounds that URL.
Naturally, I can read the comments for any URL via the Graph API (eg: a techcrunch article) but I do not know how, or if I can add comments to an arbitrary URL programmatically.
Would love to hear any other suggestions or workarounds as well. My hope is to piggy back on Facebook comments to allow my users to have a conversation surrounding URLs of interest to them. If at all possible, I'd also prefer to use Facebook, though I can see using Disqus or similar services would be another possibility.
Use graph api, demo comments here
make POST to
http://graph.facebook.com/comments/?ids=http://techcrunch.com/2011/07/22/big-surprise-the-ipad-trumps-android-tablets-at-the-office/
with field message and value "yourmessage"
I genuine Facebook API bug.
Cannot comment via Graph API on Comments Plugin (Probably try Legacy API)
Graph API

Streaming Facebook Pages Wall (not just the pages posts)

I have looked on 100 forums looking for a simple answer for how to stream every post on a Facebook page's wall (not using the like box for just the pages posts, but everyone's posts). I am the admin of the page and I am already using the like box for my posts so I understand that, however the developer pages of Facebook are too confusing for such a simple task. I will be inserting the stream into an HTML page which will be hosted on www.1and1.com so it can handle most, if not all code.
I know it is a lot to ask but is there evem someplace online that will offer plain step-by-step instructions for my specific needs?
If the social plugins they make available aren't sufficient, you could just pull in the feed with the Facebook graph api using the javascript sdk (easiest) or there is probably an SDK for whatever programming language you know. For example, you can see a list of posts on the coca cola page using the Facebook graph explorer:
https://developers.facebook.com/tools/explorer/?method=GET&path=cocacola%2Ffeed
The /page/feed method needs an access token, but you can use the graph explorer to get an offline_access token that you can use to pull the data in. This may eliminate javascript sdk usage though unless you want to first prompt users to authenticate your application. But otherwise you would just parse the json feed that is returned in the url indicated in the graph explorer (and add your access_token to the end of the url).
Here is a good PHP tutorial on how to display a groups feed on a web page. It would be just as easy to display the posts from a page (since you are the admin)
Just replace the group ID with the page ID. Here is a link to the feed for the Facebook Platform feed graph api results. More info on FB Pages here.