This article is for those, who want to know, how to make the "share" mechanism on facebook to show up a predefined image. Something like this:
The findings are based own experiences
and learnings, simply the results of my own resolving of this quest that i lately went throu. This also means: No warranties and/or whatsoever given : ) ...
The basic code is:
{geshihelper html}<link
rel="image_src" type="image/gif"
href="http://mydomain.com/images/logo/facebook/share_link_img.gif" />{geshihelper end}
The recommended code is:
{geshihelper php}<link
rel="image_src" type="image/gif"
href="http:///images/logo/facebook/share_link_img.gif" />{geshihelper end}
Note: You need php running on your site for this latter code to work!
Implementation and definition of HTML-code and image
Path
It seems, facebook preferes or expects an absolute path to the image !
Type of the Image
This seems to be crucial. The image-file seems to have to be of the type .gif -image, with alpha explicitly set to no transparency at all !
Size of the Image
What worked for me is images from up to 100x100 pixel in size. Didn't test upper-limits thou !
Mocking facebook's image-cache
This also is a crucial thing to take into accout, since facebook seems to cache the image itself and it wont turn to re-retrieve the de-facto file for quite a vast frame of time.
If it stumbles upon a link already visited, it wont even take a new glimpse, but use it's own sucked cache-copy of the image. That produces the following annoying situation, that even if you have altered your original image-file, facebook will keep on showing up it's cache-copy. And it seems to cache those for quite long.
Actually, the soloution to this is already implicitly been said: A new, unknown link facebook will look up.
And this is what we do : We present it a new, unique link, each time it comes across our site. We archive this by simply adding a GET-variable at the end of the link, carrying an unique value, which actually is the timestamp of the unix-time expressed in milliseconds. That will alter the 'total' appearance of the query-string ( the link ) enough for facebook to consider it as a new, unknown link.
Totally worked for me so far ^^
Several Images
I didn't quite find out yet, if there is any access to gaining controll over more than one single images.
It seems to me, several images only become an available option, if you let all decicion on facebook's side, not using any controlling technique at all.
Bit disappointing, but i think this attitude of facebook results in behaviour that contibutes to the security of their site.
If anyone has reliable information about, pls pls tell me. I'm looking forward to complete this article