Is Facebook Graph API the right tool for comment moderation? - facebook

I have a Facebook page that is attracting a lot of comments, and I need to stay on top of them, and Facebook notifications is not keeping up.
I am thinking of writing a small simple piece of software (Winforms/C# probably) that I can use to scan for new comments that I haven't responded to. I have created a Facebook app, and used it's credentials to run successful queries in Graph API explorer (except for not getting the "from" field from anyone that is "not me"), But it says I have to do an App Review, and for that my app has to be publicly accessible, but my tool is going to be strictly private.
Perhaps Graph API is not what I should be using for my purpose? What should I use otherwise?

Related

Graph API vs own app home feed

I'm trying to fetch the endpoint /me/home from the Facebook graph API v2.1.
Using the Graph API Explorer tool, I get good results that look like what the facebook mobile app displays. But when I switch to my app and simulate the exact same call with the exact same permissions, the results are different and include a lot of non relevant posts (such as "ARandomFriend liked a link").
The only difference beetween the two calls is the access token (same scope, same permissions, same user). My guess is that facebook voluntarily returns a less relevant feed to third party apps so that people can't build apps that can compete with them.
But maybe I'm wrong, does anyone know something about this ?
This is similar to
Some posts not visible on the feed through Graph API /me/home
and
Facebook SDK for .NET and Graph API Explorer news feed mismatch
The reason is Facebook "scores" nodes to derive the most "Top Story". Low scoring nodes are by default not visible. You can force all nodes with
/me/home.filter(owner)<some_filters like fields requests>
There is no documentation on WHY this actually works, but it does. You can also force all nodes that are Likes or Comments by doing the following
me/posts?fields=likes.filter(stream),comments.filter(stream)

Facebook Graph API, mark inbox as read?

Okay I think the title pretty much sums it up but I'll explain my situation anyway. I have written a desktop app using the Facebook C# SDK and Graph API which notifys me when I have new notifications and new (unread) messages in my inbox and it seems to work but the facebook graph api even when I use Facebooks Graph API explorer to get /me/inbox (this is specific to my facebook account) has an inbox thread that is marked as unread but does not show up on facebooks website or any of the Facebook apps i use (android/iPhone) so I can see in the api explorer everything about the thread and theres a message under the "message" field but doesn't have anything in "comments". Anyway my problem is when I use this new app i've written this keep showing up and as it doesnt show in messages on facebooks website or the facebook mobile apps, I cannot mark it as read. So is there a way to do this manually using the graph API even just so I can do it with the api explorer because I dont want it forever showing in my app, I know that i can mark notifications as read this way but I cannot work out how to mark this inbox thread as read. I could always hardcode the thread id into my app and tell it to ignore it but this is an extremely unelegant solution especially considering I am not the only person who will use this app. Even a way to delete the thread completely by graph API, is this possible?
EDIT: I have tried POST https://graph.facebook.com/(thread_id) with fields "unread": 0 but that did not work
No, there is no permissions in the current APIs that Facebook has available other than Read-Only access to a user's Inbox.

How to simulate silent login to Facebook Graph API?

I'm working on an API that will aggregate data from several website, including facebook. The API has an engine that harvests data on regular intervals, and then the client app polls the API to get the data from all websites centrally.
The problem is that the API has no way of authenticating on the regular, behind-the-scenes harvests, as Facebook insists that the user has to click on the OAuth Dialog. With the short story being that there is no way to login to graph API silently this almost means that developing such an API is not possible (except for harvesting only public data).
However, I'm not easily satisfied by "it's not possible" answers and my clients - even less so. Accessing private information on demmand is defnitely possible as Facebook apps do that. For example, the official Twitter app posts on my wall whenever I tweet. I guess apps only need a permission once and then can access the user's profile as much as they like.
So this leads me to think that I should do a combination of a Graph API client and an application that talk to each other, and whenever the API needs to harvest - it asks the app to get the data and fetch it to the API. Or maybe it should be a push model (the app sends the data whenever it's generated) rather than pull (the API requests the data at regular intervals).
Am I on the right track? Is any of these the correct design approach?
I did some searching but it's very hard to find any useful discussion on the topic as whatever keywords I try I only find "Can I login silently? No" type of discussions.
You'll want to look into the offline_access permission. This lets you access a user's data when they don't have an active session, or are offline. That's as close to "silent login" as you can get.

Liking a page on behalf of a user?

I'm trying to get a user to 'Like' a page via the SDK. User is signed in and I get a valid access tokken form the cookie. My APP has asked for permissions read_stream and publish_stream. I can successfully do things like post to their wall, etc. But when my APP tries to 'Like' a page, I get the error back:
OAuthException: (#3) Application does not have the capability to make this API call.
Am I missing some other permission, or is there a setting I have to turn on in my APP? I'm at a loss here.
You can't like a Page on behalf of a user (Bugzilla discussion). You can, however, like posts, comments, and photos on behalf of a user.
Edit 7/9/2012
Since bugzilla no long exists, the bug linked above is inaccessible. Google doesn't have a cached version of the page, so I ran another search. The best thing I could come up with was this Google Code Discussion regarding the ActionScript API.
Facebook makes brief mention of Publishing likes via the Graph API in the documentation, but doesn't say one way or another whether you can like a Page on behalf of a user - just "Objects" which (probably arguably) are not "objects" in Facebook-lingo.
My thought is, the API to like page is available, but is only offered to white listed applications (such as, the Facebook iOS and Android applications) written by "special" publishers. There's obvious reasons why Facebook wouldn't want/allow developers to create like connections on the graph. It would be taken advantage of by spammers and other nefarious developers and would deteriorate the meaning of what a "like" represents for a page on Facebook.
My guess is, you'd have to make a pretty strong case to Facebook about why you need/want access to the Page's Like connection (for publishing) before they'd even consider giving you access. I'd also guess that they'd want to verify that you're doing only user initiated like creations (in such a way that the iOS application would handle it) so as to protect the reptutation/meaning of a "like" action.
Actually this is NOT true, but you have to do a complicated Javascript / UIWebView process in order to display a Facebook 'page' of JUST the like button on your view, and this like button you can configure in the JavaScript / Objective-C (using string replacement) to be any Facebook page url you like.
Facebook's platform policies don't allow for a web-based like button aside from using the officially supported options
Those options doesn't require using OAuth or the Open Graph api. However, facebook just added support for mobile apps to send like actions through opengraph.
I'm not sure if they intend to allow sites to customize their like buttons or just apps...
Liking works for me with the iOS SDK using the graph api:
https://developers.facebook.com/docs/opengraph/actions/builtin/likes/

Hiding application source when posting to Facebook fan page via graph API

I've successfully posted to a fan page as the actual page via the Graph API.
The problem is that the post says it was posted at "time via application name". Is there any way to hide this, so my post looks exactly as if I typed it directly into Facebook?
I'm building a messaging center that can easily deliver messages on many different channels, Facebook being one of them. Clients probably won't appreciate their Facebook posts linking to my application, nor do I want to set up a new Facebook application for each client.
There is no way to disable this. It is an internal Facebook system and is very deliberate on their part to show users where content comes from and make it easier to report malicious and spammy apps.