How to get Open Graph objects associated with an application or Facebook user? - facebook-graph-api

I recently set up a Facebook application so that I might be able to send messages to people who 'like' things). I managed to figure that part out, but now I'm stumped again.
As far as I have seen, every open graph object that is created will have a reference to a app_id if the page had a fb:app_id open graph meta tag. However, I haven't seen anything in the Open Graph API that allows me to get a list of Open Graph objects associated with an app_id (this question has some insight, but doesn't provide a lot of information).
Alternatively, since I know that the pages will have a similar URL, I was investigating FQL to see if it is possible to find pages where the URL matches some pattern (either using strpos or the IN operator). No luck there either (condition fields needs to be indexed).
Lastly, I considered using the fb:admin metatag, because apparently it is possible to see which pages a user administers. In this case, I haven't figured out how to become administrator of the Open Graph object, so I am again stumped.
Is there any way, however roundabout, to get open graph objects associated with a Facebook application or user?

There's no way to get a list (from Facebook) of objects it knows are associated with a given app_id. Facebook only "knows" about your custom OG objects when it crawls them, and its only going to crawl them in when an action is taken with your OG object as a target. The best way to keep track of OG object for a given app is to track the result of OG API calls that create these actions (you'll get an fb_action_id).
Same with users. You can track which users are associated with your App in response to successful calls to FB.login or FB.getLoginStatus. You'll need to track actions taken by that user yourself.

Related

How To Get List Of Apps A User Has Used

I was hoping to use the Graph API to retrieve a list of apps that the user currently has on their account - those that they are using or have used, and have not yet removed. This would be the same list as found by clicking App Centre and My Apps.
I'm not looking to get info about a specific application (yet; I don't know what app to look at, or how to get its ID).
This article: How to get the List of Facebook Applications for a user using Graph API
seemed to be the right answer (and the OP certainly liked it), but for me, while it works, it returns an empty array - but I have about 20 apps (mostly games) listed on my profile, half of which are in favourites. I don't need to know which are in favourites; I simply would like to know what apps a user is interested in.
I realise this is considered sensitive information, but since I cannot find what string to use for the api() method, I can't tell what permissions I'll need; I currently ask for read_stream but since the call itself succeeds, I assume I have sufficient privilege.
I see that you can list the app requests using /me/apprequests, which suggests you should be able to retrieve the list of apps (that's where the requests come from, usually, except invites to new games) - but I can't find anything that seems right.
Any ideas?
Thanks.
No, it is not possible to retrieve a full list of the applications that a user has TOS'ed.
As described in the comments to the OP, it is possible to deduce some of them from /[user]/scores assuming they have granted the user_games_activity permission.

Is it necessary to create pages with the recent changes to the Facebook like button?

I was reading over the changes to the Facebook Like button that are scheduled to take place in November 2012, and I'm a bit confused (and hoping someone has an answer).
I understand that the REST endpoints are being removed in favour of regular pages, but here's where I'm confused.
Previously, if I did the following...
Create a page
Add the correct OpenGraph metatags to the page
'Like' the page
... Then an OpenGraph object would be created automatically (and could be verified by visiting http://graph.facebook.com/?id=my_url). If I published to that OpenGraph object, people would receive updates.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created? Or it is created, but I still need to create a Facebook page to administer and send messages?
Any help would be appreciated.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created?
That phrasing is a little besides the point.
You create the Open Graph object, by setting up a page with appropriate OG meta tags.
And Facebook will count likes for this URL, like for every other URL.
Or it is created, but I still need to create a Facebook page to administer and send messages?
No admin pages will be created automatically any more; although you can convert existing ones to normal public Facebook pages. But then you have to point the like button to the URL of that new Facebook page instead of your OG URL to be able to publish updates to your fans. (So this will behave basically like a normal Facebook page that was set up to be one in the first place; only this step allows you to “migrate” your existing likers for your OG URL to that page, so you don’t need to have a “fresh start” with your Facebook page.)
The document further describes, what to do if you still need the ability to publish updates to the users liking your OG URL – by providing fb:app_id and fb:admins meta tags:
“This will ensure that the Like Button admin link still appears on the given Open Graph page. The admin page for a given Like Button is also accessible to administrators from https://www.facebook.com/bookmarks/pages”
But publishing updates this way will only work until the Like Button admin page is fully deprecated. From then on, you will have to use a Facebook page, if you want to be able to publish updates to the users who liked your page.

Should I explicily add/delete OpenGraph objects that are added to / removed from my site?

Some OpenGraph newbie-isms:
Suppose I put up a page on my site that is properly marked with OpenGraph metatags to indicate that it represents a OG "video" object. This is a straightforward implementation of the OG Video spec; no custom stuff is involved. Two questions:
Should I do some sort of POST to Facebook to tell it that the page/object exists, or do I just wait for a user to hit the Like button or do some sort of other Facebook-y action on the page (which, as it seems, will lead Facebook to scrape the page and do whatever it does with it)?
If the page is removed from my site, should I then do some sort of POST to tell Facebook that the page has gone away?
There is no need to explicitly tell Facebook about the existence of an Open Graph Page. When someone clicks the like button for the first time (or shares the link on Facebook by some other way) the Facebook servers query the URL to read the OG Tags so it knows what the Newsfeed story should look like.
Similarly there is no need to inform Facebook that the OG Page has gone away. That being said it is better to just allow your OG pages to continue to exist if possible to ensure they continue to drive traffic to your website.

Facebook custom graph action not appearing

I found a very similar question here: Actions do not appear on timeline, but the solutions offered there are not working for me.
I created a custom graph action and a custom graph object through my Facebook application, and the process of publishing seems to be working fine. When I post the data using the JavaScript SDK with my access token and the object ID, the Facebook API returns the ID of the action, which I can then access on the graph. This side of things is clearly working, since accessing the object via the graph with my app's access token returns all the information it is supposed to.
However, I see no record of this action on Facebook itself; not on my app's timeline, not on the aggregation I set up for this action. The solutions offered in the link above entail double-checking the validity of the meta tags, which I did using the debugger, and also ensuring that there are no URLs within the meta tags that are inaccessible, which is also not the case. Is there anything else that could prevent these actions from showing up on the timeline?
Thanks!
There can be some permission error for facebook (and thus global users) for some url. If you get the action response id, it has to be in your facebook timeline at least (not in others excluding the developers and testers of your app) and it really occurs almost real time.
PS: If you found a similar questions elsewhere, please try to go on with the discussion there instead of creating a duplicate question.

Retrieve comments Facebook users make as the Like a web page

I've been pouring over Facebook's Graph API but I can't seem to find any documentation with regards to retrieve comments users leave as they Like an Open Graph object (in my case, a web page with a Like button).
At a minimum, I would assume that there would be some way to retrieve comments from users whose privacy settings allow anybody to see their updates (I guess this might require me to know the UID of everybody who Likes my web page). Alternatively, there might be some method where user comments may be associated with the Open Graph object's stream instead.
Anybody?
To see a user's wall feed via the API (even public ones) you will to have them authenticate your app. Yeah, pretty crappy not to be able to query their public messages, but it is a current limitation of Facebook's API.