Post an OpenGraph action for Like and Comment without using Like and Comments plugin - facebook

I am using GraphAPI to send comments and likes to a facebook photo from my site. The problem is I want to post the action to the user's wall, one which should be viewable from their friends' news feeds like "ChrisB liked a link" and "ChrisB commented on a link", where link is the photo's url on facebook. Of course I expect the photo thumb and name and description to appear on the post as well.
I have attempted to use custom OpenGraph actions and objects for these, but og:url won't accept facebook links now (which is odd because it still works for facebook pages). The error I'm getting from the linter is "Facebook urls cannot be crawled".
Is there any way to get the result that I want?

Instead of using a Facebook URL directly, try using bit.ly links or some way of automating the redirection from your site to Facebook. For example, I would use the apache module mod_rewrite to create a page on my website, but have it redirect to Facebook.
E.g. 'fake page' would be domain.com/{photo_id}.jpg, but have mod_rewrite redirect to http://www.facebook.com/photo.php?fbid={photo_id}

Related

facebook feed on personal page

I Use the Facebook API Graph on my website to feed posts.
The problem is that I can't figure out how to feed on my facebook personal page. I can only feed on my facebook normal page.
The feed looks like this:
https://www.facebook.com/dialog/feed?app_id=xxxxxxxxxx
&redirect_uri=https://www.mywebsite.com
&link=https://www.mywebsite.com/
&title=title
&picture=https://www.mywebsite.com/picture.png
&caption=caption&description=description
Can I add somewhere the url of my persosnal page to post directly on it?
With the Feed Dialog, you can only post to your user profile. Try the Share Dialog instead: https://developers.facebook.com/docs/sharing/reference/share-dialog
...you can even omit all parameters except for the URL, because it will just get the data from the Open Graph Tags.
If that does not work, you can also use sharer.php: https://www.facebook.com/sharer/sharer.php?u=[urlencoded-url]

Facebook appends parameters to a url when it is liked

I’ve recently added a Facebook like button to a site of mine and all seems to work fine except that the post on my Facebook wall has a url with a load of parameters appended to the url.
Example: http://domain.com/this-is-a-new-post-to-test-the-url?fb_action_ids=1403388974344336068&fb_action_types=og.likes&fb_ref=sp_facebook_57&fb_source=aggregation&fb_aggregation_id=247881481237582
I have set the open graph meta tag but this does not seem to make any difference.
What I find interesting is that some pages I’ve liked (on a different domain) don’t have these parameters appended to it.
The question is: how to “sanitise” the url on my Facebook wall so it looks like http://domain.com/this-is-a-new-post-to-test-the-url and NOT like http://domain.com/this-is-a-new-post-to-test-the-url?fb_action_ids=1403388974344336068&fb_action_types=og.likes&fb_ref=sp_facebook_57&fb_source=aggregation&fb_aggregation_id=247881481237582
Facebook adds these parameters so that website owners can keep track of where incoming traffic from Facebook originated and can not be removed.

Like button for Facebook page shows generic Facebook description in News Feed

I want a Like button on my web site that Likes my Facebook profile (rather than my web page), so that when a user clicks it they subscribe to my Facebook posts.
I've created the Like button using the tool at https://developers.facebook.com/docs/reference/plugins/like/
Further down that page there is an FAQ entry:
Can I link the Like button to my Facebook page?
Yes. Simply specify the URL of your Facebook page in the href
parameter of the button.
So, I've edited the href parameter to point to my Facebook page. eg:
https://www.facebook.com/myfacebookid
When a user clicks the Like button it has the desired effect. The user ends up having Liked my Facebook page. This is easily verified by the user going to my Facebook profile and checking that the Like button has changed to Liked.
But. When the user clicks the Like button, and entry appears in their News Feed with a generic Facebook description. ie:
Facebook is a social utility that connects people with friends and
others who work, study and live around them. People use Facebook to
keep up with friends, upload an unlimited number of photos, post links
and videos, and learn more about the people they meet.
I don't want a generic post about Facebook to appear. I want the description to relate to my Facebook account and/or web site.
Normally, I could modify this behavior with the Opengraph og: description tag, but as the page in the href is a Facebook page and not my own, I can't control the Opengraph tags.
I'm pretty sure that this was working okay before I enabled timeline for my account, so maybe this is a timeline bug?
So, how do I add a Like button which a) Likes my Facebook profile rather than one of my own web pages, and b) Posts a description of my Facebook profile rather than give a generic Facbook description?
Are all your fields in the info part of your page filled in, and/or completed? I just tested your theory and it seemed to work as expected, only thing is I know all fields in "info" are filled it. Give that a try.
This may happen if you have filled invalid/incomplete/wrong og tags in past and later changed them. Facebook's cache creates problem sometime.
Try putting all the entries (i.e. all og tags) and then debug them here http://developers.facebook.com/tools/debug. This debugger gives a detailed info about the url with og tags and also clears the cache for you.
This should solve the problem.
You have 3 important fields that used on page opengraph: Name,Description,Profile Image.
They are used when some one post your link on Facebook, or Google or some else web service that handle opengraph.
Actually, the suggested answers currently do not work and there is an open bug / ticket on Facebook for it. Up to now, there's no fix.
The problem is that you can not use simply https://www.facebook.com/myfacebookid. You should copy and paste the exact page URL. If you have a low number of likes it would look something like https://www.facebook.com/pages/[YourPageName]/[Your page Id]/, and this is the URL that you should use at this point.
If it does not work, try also https://www.facebook.com/[YourPageName]/[Your page Id]/.
In short, copy-paste the URL, do not type it manually.

Display and post comments on facebook photo from webpage

We would like to use the Facebook Comment plugin (or something similar) on a website. The photos are being pulled in from Facebook to our site (built in PHP). We would like to enable commenting on a particular photo and post the comment back to Facebook. Addtionally, if a comment is made on Facebook, we would also like for the comment to display on the webpage.
From the website, we have only been able to get the comment to apply to the webpage, but not to the photo itself. Thus the comment posts on facebook with a link to the webpage, but does not display the individual photo.
Does anyone know how to successfully post comments on a particular photo from a webpage?
Using the Graph API, just do an HTTP POST to https://graph.facebook.com/PHOTOID/comments?access_token=ValidUserAccessToken with the correct parameters specified (such as message) as well as a user access token with the correct permissions specified.
See the comments connection of photo at https://developers.facebook.com/docs/reference/api/photo/

Using Open Graph Protocol to Link Site with Facebook Page

I have a website at http://www.mydomain.com which has a corresponding facebook page at https://www.facebook.com/pages/mydomain/123456789.
I am looking for a way to integrate this facebook page URL into the open graph headers so that when someone shares my page, it actually shares the Facebook page instead of the site's URL.
Is this possible?
You can now do this by setting the og:url meta tag to the url of your Facebook page. Keep in mind that if you do this, other networks that use Open Graph tags will probably share your Facebook page instead of the site's url, so make sure that's what you want.
<meta property="og:url" content="http://www.facebook.com/your-page"/>
Perhaps you already figured this out as this is an old question, but since I stumbled upon it... If I understand your question correctly, you do not even need the ogp meta tags to accomplish what you want to do. All you need to do is go to http://developers.facebook.com/docs/reference/plugins/like/ and input your facebook page url in "url to like", https://www.facebook.com/pages/mydomain/123456789 from your example. Then select the options you want including the "send" button. Then get the code and paste it where you want it in your website. Now whenever someone clicks "like" on your website or clicks "send" to share your website, they will actually be liking or sending the url to your Facebook page and not your website. Is that what you were looking for?