Facebook OpenGraph - POSTing using the FB.api - facebook

This might be a beginners question, but I have to ask it nonetheless since I don't really understand this. I have successfully debugged my page and the user is authenticated to use the app. So the debugger is picking up all my meta og: tags properly. Running the below function allows me to a post a status update to my timeline which is 'A status update'. But that's not what I want, I want the meta og: tags to create a great looking page specific post which Open Graph is all about, but that doesn't happen, it's just a plain old boring status update with a link to my page. Why?
FB.api(
'/me/[my namespace]:button',
'post',
{ message: 'A status update' },
callback function
});
Additionally, what am I actually supposed to put in the third parameter, what is the third parameter for? That is the {message: 'A status update'} parameter.
Finally, is this the way to post to timeline using opengraph and apps? I am not sure as I don't know what that stuff they have when I 'get code' on the developers page is. That curl stuff, what's that for? I can't have that on my page?

But that's not what I want, I want the meta og: tags to create a great looking page specific post which Open Graph is all about, but that doesn't happen, it's just a plain old boring status update with a link to my page. Why?
Because you’re not giving the address of any Open Graph object with your action … there’s no URL anywhere, so where do you think Facebook should pull the OG meta data from …?
Set your action up in a way so that it references some kind of OG object, and then give that object’s URL when you’re publishing the action.
The examples in the Open Graph documentation in the developer section should make pretty clear how it works.
https://developers.facebook.com/docs/opengraph/actions/#create

Related

Does Facebook infer OpenGraph descriptions from page content when missing?

This is not my website/I have no connection to it, but I'm trying to understand how Facebook gets content using OpenGraph tags exactly - specifically, if a tag is missing does it attempt to read website content to generate one? And if so, is there a programmatic way to tell if Facebook has done this?
The example: This website for a nonprofit called Hekima Place doesn't have an og:description meta tag, as the Facebook Sharing Debugger reveals. However, it still gets an og:description value and a proper description in the card, which seems to match a "What We Do" section's <p> tag further down on the page.
When checking the Facebook Open Graph Object Debugger for this site, it doesn't seem to mention that the description is inferred anywhere. Is it also possible that such a description might have been entered somewhere in a Facebook dashboard to fill in that data?
Thanks in advance!

How to send multiple link to facebook debugger

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.

Working with Facebook like API and opengraph

The Documentation from facebook isn't understandable, atleast for me.
I have never worked before with facebook and had a basic requirement of putting a like button on Product pages.
So yesterday, I added the OpenGraph meta tags and like button to my Product pages as stated in this documentation, https://developers.facebook.com/docs/opengraph/. I also created an app, as the document stated that it has extended the basic meta data to add a required field to connect your webpage with Facebook: fb:app_id.
The like button has been set but i have few queries which are as following :-
For some pages, the like button doesn't read the og tags. Rather than publishing the whole thing in a story manner by reading og tags, it just shows a link. During googling, I read it happens because of facebook caching and since, I shared the link on facebook before putting the meta-tags, this is happening. So, Is there any way that I can direct facebook to reset all the caching for my pages or scraping that it has done earlier.
Though I have created the App, I actually have no idea what to do with it. Why is it needed and what matters it can help me with.
I tested one of my URLs here: Facebook Linter but it shows some error and stuff which i can't understand. Below is the image. Please tell if I have done anything wrong and why it's showing these errors
Documentation for OpenGraph on Facebook containing outdated information about pre-defined types, see OpenGraph Types. You probably need to define your custom Object Type "Product" in for your Application/Site using Developer Application in Open Graph settings.
You may want to read Documentation for OpenGraph beta too.
Update:
There is a similar question about exactly this og:type: Opengraph meta tag og:type set to “product” errors (like button & URL linter/debug)

Feed dialog to event/fan page says "Sorry, something went wrong." after clicking share

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/

How to achieve dynamic fb actions?

My site has a feed system and when user clicks on any one of those feed snippets (the object), I want the action to be publish in their Facebook news feed. So I'm really confused on how to go about it because as far as I'm aware this is how you post actions on Facebook's JavaScript SDK:
FB.api('/me/namespace:action?object=url','post')
How do you dynamically change the properties of the object? Are there parameters you can send? As far as I'm concerned, Facebook asks you to give pass a URL and it'll grab the <meta> information from that URL?
Am I supposed to perform a GET request with my own server and change the meta tags dynamically. This sounds like more work than it needs to be. For example, what if the feed includes a paragraph of text, it'll be impractical for me to post that as a get request and then urldecode the entire thing.
I'm not sure I totally understand your question, but...
You can dynamically change the tags for facebook og: properties, but you have to do it before the page loads (e.g. using PHP as opposed to javascript). After you send the post using the javascript SDK, facebook crawls the page and looks for the info in the og: meta tags.