Reputation: 2034
I work for http://pastebin.com and we have a facebook LIKE button on the site.
The LIKE button in the menu on the bottom right puts a LIKE out to our frontpage.
Now the LIKE gets stored, but the data about pastebin is all messed up. It fetches some http header data, and posts that. It only happens with the LIKE button in the menu on the right, the LIKE button at the top of posts works fine. http://pastebin.com/cYkKMdT7 like the one at the top there.
This is how it gets pasted to peoples wall.
Any idea why this happens?
I tried both the iframe and the javascript code.
Upvotes: 1
Views: 5887
Reputation: 253
Just another late answer. THE problem with facebooking ajax content is THE SAME, as with all other crawlers: Facebook takes data NOT from the browser view, where the user clicks the Like button (and where you have all your ajax stuff loaded) - instead it issues its own http request to the specified URL. That means, that you cannot generate your metadata dynamically by the script associated with ajax requests - you have to provide all required metadata in the plain html, that you give off to facebook's robot (exactly the same way, as you would handle googlebot requests). You can see precisely how your page appears to Facebook with their linter: http://developers.facebook.com/tools/debug
Upvotes: 1
Reputation: 2034
Ok I found the solution, removing a bit of the iframe URL where action=like, solved the problem. It was a problem with facebooks code i guess.
Thanks for the help though :)
Upvotes: 1
Reputation: 6530
First of all, love your site :D
You can control what appears on facebook after a page gets liked by using open graph protocol tags. Refer for more info: http://developers.facebook.com/docs/opengraph/
More specifically, you need to put the description in <meta property="og:description" content="Description here"/>
. These tags should be in the head section of your HTML markup.
Also, these tags are required, if you want to use any Open Graph Protocol tag:
og:title - For the title of the share. You could use the title of the particular pastebin
og:type - There are several Object types. For Pastebin, you could use website or article
og:image - Put the URL of the Pastebin logo here
og:url - The URL of the page
Example code:
<meta property="og:title" content="Pastebin"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://pastebin.com/cYkKMdT7"/>
<meta property="og:image" content="http://pastebin.com/i/logo.png"/>
<meta property="og:description" content="Pastebin excerpt "/>
Upvotes: 3
Reputation: 17692
It looks like you haven't implemented the Facebook Open Graph Protocol for your website. There are several META tags that you can add to the headers of your pages that give you much finer control about how Facebook sees them when a user clicks the "Like" button on your site.
Upvotes: 2