My site is using the Facebook comments box plugin. I can access the comments using the graph api for my iOS app by calling:
https://graph.facebook.com/comments?ids={url}
However, if the url referenced above isn't visited at least once in a browser I'll get the error:
{
error: {
type: "Exception",
message: "Unknown identifier, ",
}
}
It makes sense that the url hasn't been registered yet via the plugin. However, I might be accessing these urls in my iOS app before anyone visits them on the web. Does anyone know of a graph api call that will register the url with Facebook? If my situation were read only I would simply say there are no comments but I have the same problem when trying to post a comment.
You can programmatically scrape a particular page containing a social plugin by making a CURL (or similar) call to:
http://developers.facebook.com/tools/debug?url={YOUR_URL}&format=json
This is mentioned in the OG docs at http://developers.facebook.com/docs/opengraph/#edit although links to the older URL for the OG Linter.
I believe linting/scraping a page such as this should register any social plugins on the page without requiring you to visit the page first.
Edit: See also the Updating Objects section at the bottom of this doc: https://developers.facebook.com/docs/opengraph/objects/
Related
I have a website with some dynamic urls (for example a page who show event details thanks to event id in get variable), but during the share with facebook, at the first attempt the thumbnail image doesn't appear due the page isn't already fetched by facebook.
Then I must go to the debugger https://developers.facebook.com/tools/debug/og/object/ and submit every pages to get a valid thumbnail to the users.
There's a script or a way to send multiple links to this debugger, or there's another way to achieve the indexing of new pages by facebook?
You can refresh the Open Graph tags with a POST request to the Graph API, i think it´s not in the Facebook docs (at least i could not find it) - but it definitely works:
$.post('https://graph.facebook.com', {
id: 'http://www.yourdomain.com/somefile.html',
scrape: true
}, function(response) {
console.log(response);
});
Just an example with jQuery, of course you can just use CURL on the server too.
I have a page inside a facebook application that is an opengraph object, when I post a custom action on this object to facebook from my app it is posted right, but when I use a facebook social plugin such as like and like that object it is not posted as that object but instead the object of my facebook application is posted on the timeline... so my question here is Can an in-app object only be posted through an opengraph action?
Nope, new OpenGraph object will be created or data will be updated for existing one once Facebook linter crawl your page to get data this will happen in several cases:
OpenGraph action referencing object published
Like button clicked for specific URL
Link to your page shared on Facebook (in direct way or via any dialogs using link, etc).
Your Like button is probably linked not to your real application URL but to URL within Facebook resulting in different Pages parsed by Facebook on Like Button click and OpenGraph action publishing.
I assume that your like button pointing to Application Tab Canvas or Application Page since links to regular application's canvas parsed correctly by Facebook.
Update:
Seems like the issue with OpenGraph tags is related to the fact that your application returning 404 (Not Found status code) for URL you provided and only returns data for HTTP (but not HTTPS) requests. If error code is returned the cached data is preserved and will not be updated until correct status code returned.
Update 2:
As you've provided real URL it's became clear that you get details for your application instead of actual page because of redirect for all unauthorized users, which lead to inability to rich the real OpenGraph data by Facebook linter.
BTW, You should be aware that every OpenGraph object MUST have publicly accessible URL.
I'm experiencing some problems getting an Open Graph implementation working.
As far as I can tell, I have the correct meta tags present. When I paste an URL into the Open Graph Debugger, it returns with the proper information defined (title, description, image, etc), and no errors.
I have version 3.1.1 of the Facebook PHP SDK.
I have Open Graph enabled for my development app, and I have an action (read), and an object (article) defined.
The implementation in question is a website, not a facebook application. On facebook, the app's "category" is "other". I followed some advice in another thread, and changed it to "Game", which did not work, so I have changed it back.
I authenticate my web app user with facebook and receive a code, which I then trade in for an access_token, pretty standard. I ask for the following permissions:
publish_stream
publish_actions
offline_access
However, when I attempt to make a call to publish an action, I receive an OAuthException, and have no real way of debugging it.
Some oddities:
The graph API doesn't seem to like the URL format specified in the documentation: me/[app_namespace]:[action_type]. In my case, this would be me/' . FB_APP_NAMESPACE . ':read, where FB_APP_NAMESPACE is defined earlier to be a namespace as defined in the facebook application settings. Both the API and the Graph API Explorer throw an error stating that it doesn't understand the action given. It seems to be trying to read the namespace as the action.
If I remove the namespace from the url, it reports that the passed in action doesn't match the og:type defined in the url, since the og:type in the url contains the same namespace I removed.
If I remove that namespace from the meta tag, and try again, I get a generic OAuthException that I can't debug.
When I look at the code sample provided in my facebook app, the action seems to be news.reads instead of just read.
If I use that action, the graph API returns an error saying that my ID is unauthorized to use the open graph, as it is not an admin, dev, or tester for my application. Unfortunately, I am the app creator, which means either the graph API is lying, or I am lying to myself!
I think the solution is pretty simple - perhaps I have forgotten something, or selected a certain category incorrect. Either way, this is a little frustrating, to say the least!
Apparently, facebook's default read call isn't available to use if your application/action isn't submitted.
I ended up creating my own read action, and it worked on the first try. Go figure.
For predefined actions the post url's are slightly different, you will have to use something like this:
POST https://graph.facebook.com/me/news.reads?article=[article object URL]
See: https://developers.facebook.com/docs/opengraph/actions/builtin/#read
We have an app on Facebook called TouchActive
We provide ways for user to post content to Facebook, either from web (via AddThis) or native Android/iOS app.
When we post from say Android we identify the app and the post appears correctly, showing "... via TouchActive" all fine.
When we post from web, we post a URL that Facebook queries, and we provide an OpenGraph response from our server with all the og: meta tags, including the facebook app_id.
The content appears correctly (it's parsing the OG response OK), but it doesn't show as posted via our app, and the posts don't appear in our Insight statistics for the app.
We are assuming this can be done.
Anyone know what we could be doing wrong in our open graph response that causes this to not work?
I have tried the Facebook debug tool https://developers.facebook.com/tools/debug and it shows the correctly parsed OG response and no errors, only a warning about og:url.
Is og:url recommended or a MUST for this to work?
Andrew: I am also using the same meta tag for my site and it works as expected and the post is attributed to my site. I guess u should specify the og:url meta-tag once and then check. As this url is used on the attributed app's anchor link on fb wall.
If still it has the same issue then we can dig it more to come to solution.
A user manually sharing a link to or liking a web page which has opengraph meta tags (including an App ID) is not the same as posting the content from the app - are you definitely posting the links using the app?
You must post via the API to get the post attributed to your app, regardless of which app is specified on the page's meta tag (which is done primarily for insights and administration purposes)
Having some issues with the feed dialog when attempting to post to a event or fan page. In my application I am using the JS API and FB.ui using the method feed.
But for a demonstration you can do it using the feed url too for example:
http://www.facebook.com/dialog/feed?app_id=131727613511269&to=287203454659917&redirect_uri=http://www.timeanddate.com/
After clicking share you get the:
Sorry, something went wrong.
We're working on getting this fixed as soon as we can.
Where:
app_id = your app
to = a event / fan page
redirect_uri = a url you are allowed to redirect to
note that the app has publish_stream permissions. (it also has manage_pages for fan pages)
The app in question by the way is: http://apps.facebook.com/tndcountdown/
Thanks,
Andy
EDIT:
An Example taken straight from the documentation:
http://www.facebook.com/dialog/feed?app_id=123050457758183&link=http://developers.facebook.com/docs/reference/dialogs/&picture=http://fbrell.com/f8.jpg&name=Facebook%20Dialogs&caption=Reference%20Documentation&description=Using%20Dialogs%20to%20interact%20with%20users.&message=Facebook%20Dialogs%20are%20so%20easy!&redirect_uri=http://www.example.com/response&to=287203454659917
just replace to=287203454659917 with an event.. (make a test one like it did there)
A few issues I've run into will dialog is that Facebook tries to fill in any missing data. So if you don't provide a description and caption, Facebook will try to scrape the page to get that content. Depending on how the page responds to the "scraping" Facebook will error out. I always make sure I include at least a space for those fields.
It seems the feed url you provided is similar to what is in the documentation. But the demo in the documentation has extra parameters.
I'm about to add page support to my Facebook app, which does the same thing as yours.
http://apps.facebook.com/countdown-timer/
As I posted here - Facebook Send Button - 'Sorry, something went wrong.'...
I had the same problem & worked out that this was due to linking to a Facebook page that did not have a vanity URL set up (i.e. http://www.facebook.com/CubicMushroom rather than http://www.facebook.com/profile.php?id=261963707177053). If you set up a vanity URL for the page it seems to work OK (providing you link to the vanity URL version of the page URL).
To claim a vanity URL, once you have a certain no of like (it used to be 25, but think it's a little lower now) visit https://www.facebook.com/username/