3

Possible Duplicate:
How does Facebook Sharer select Images?

I've added a facebook "like" button on my site (I know, pretty sad).

However, my main logo is just text (styled with @font-face) which, I think, is a good thing since it's small and more accessible etc.

When someone clicks "like" and chooses to post this action to their wall, the only image facebook finds is a twitter icon. Is there some way I can trick facebook into using a different image as the default image for my site. I've tried adding an image but using CSS to not display it, but it didn't work.

Any other ideas?

Update: opengraph looks like the way to go. However I tried it and it still isn't picking up my icon. Can you spot any mistakes in my meta tags? stolencamerafinder.com

Solved: opengraph works fine. (If data is stale, use facebook's linter to update their cache)

Community
  • 1
  • 1
matt burns
  • 24,742
  • 13
  • 105
  • 107

2 Answers2

4

add this meta tag

<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>

more here https://developers.facebook.com/docs/opengraph/

Bruce Aldridge
  • 2,907
  • 3
  • 23
  • 30
  • opengraph looks like the way to go. However I tried it and it still isn't picking up my icon. Can you spot any mistakes in my meta tags? http://www.stolencamerafinder.com – matt burns Apr 17 '11 at 06:56
  • works for me .. http://imgur.com/HJbHd – Bruce Aldridge Apr 17 '11 at 07:17
  • Thanks. When just share a link (as in your screenshot) I see it works for me too. But when I click the like button on my website, it is using some old cached values (even the html title value is old). It looks like it cached on fb's servers somewhere. – matt burns Apr 17 '11 at 10:19
  • 1
    For the changes to be reflected on Facebook, you must force your page to be scraped. The page is scraped when an admin for the page clicks the Like button or when the URL is entered into the Facebook URL Linter. You can programmatically force your page to be scraped by cURL'ing the linter. For example: curl https://developers.facebook.com/tools/lint/?url={YOUR_URL}&format=json – Bruce Aldridge Apr 17 '11 at 11:35
  • thats from the link in my answer – Bruce Aldridge Apr 17 '11 at 11:36
  • Yep, the linter did the trick, thanks. – matt burns Apr 19 '11 at 11:23
2

Go here for more description

You can call this function rather than share and customize your share. You have to use Fb init with it.

function post_to_fb() {
    FB.ui({
        method: 'feed',
        name: 'share',
        link: 'share link',
        caption: 'caption',
        description: description,
        picture: 'image link',
        message: ' text'
    }, function(response) {
        if (response && response.post_id) {
        }
        else {
        }
    });
}
clairesuzy
  • 27,296
  • 8
  • 54
  • 52
ankur.singh
  • 658
  • 5
  • 11