Trick Facebook Scrapping of Facebook Tab URL

I constantly run into issues with Facebook scrapping the wrong information off of a page, when all you’re trying to do is put a simple Like, Recommend, or Send (or custom share) button on your page.  This is especially problematic when you are working with a Facebook tab.  In a failed attempt to make Facebook scrape one of its own Facebook tabs, it scrapes the root page’s basic info (Info tab) every single time. 

For example, while trying to share via Send button a link to http://www.facebook.com/DietCoke?sk=app_296328391504, which is Diet Coke’s Home tab, Facebook is likely to scrape the page’s Info tab and you’ll see:

image

 

One way to get around this is by creating your own redirector page that forwards to the appropriate Facebook tab while at the same time providing Facebook with the meta data you want it to scrape. 

This dummy page consists of two main things:

  1. Meta tags adhering to the OpenGraph standard which specify the title, URL, description and thumbnail of what you want to share.
  2. Meta refresh tag that immediately redirects to the appropriate Facebook tab.

Here’s sample content for the dummy/redirector page:

   1:  <html>
   2:    <head>
   3:      <meta http-equiv="refresh" content="0;url=http://www.facebook.com/DietCoke?sk=app_296328391504"> 
   4:   
   5:      <meta property="og:title" content="This is my title" />
   6:      <meta property="og:type" content="activity" />
   7:      <meta property="og:url" content="http://www.mysite.com/redirect/" />
   8:      <meta property="og:image" content="http://www.mysite.com/logo.jpg" />
   9:      <meta property="og:site_name" content="I'm on Facebook!" />
  10:      <meta property="fb:admins" content="123456789,2345678912345678" />
  11:      <meta property="og:description" content="Hello World!" />
  12:    </head>
  13:   
  14:    <body>
  15:    </body>
  16:  </html>


In this example we are redirecting to a specific tab on the Diet Coke page.  Facebook will ignore this redirect, but it will scrape the meta tags and retrieve the info we specified.

This particular solution (while not pretty) works well for Facebook-specific sharing buttons such as Like, Recommend and Send. 

If you can suggest a better alternative, please do!

Published Tuesday, June 07, 2011 12:51 PM by fallen888

Comments

# Trick Facebook Scrapping of Facebook Tab URL | ASP.NET and Web | Syngu

Pingback from  Trick Facebook Scrapping of Facebook Tab URL | ASP.NET and Web | Syngu

# re: Trick Facebook Scrapping of Facebook Tab URL

Wednesday, December 21, 2011 6:04 PM by John

I've been fighting with this all day. I'll give this a shot. Thanks for posting!

# re: Trick Facebook Scrapping of Facebook Tab URL

Tuesday, February 07, 2012 4:52 PM by Chris Donaldson

I've been using this trick as well but have come across an issue with the URL displayed when using it for send/comment etc.

I have a number of different pages/clients I want to add the send button to but I want to host them all on the same URL (so I only have to have one SSL). The trouble is that FB ignores the URL og property and displays the URL where the redirect page is actually hosted. This link is also on the 'site name'

In your example it would display 'http://www.mysite.com rather than www.facebook.com/dietcoke

Do yo know anyway of overiding this so it displays the URL of your choosing?

Leave a Comment

(required) 
(required) 
(optional)
(required)