Catching facebook
Showing special content to the facebook crawler, when using the "share on facebook" feature.
Written by Daniel, February 7, 2010
I needed to catch when Facebook was checking out an app I did via the “share on facebook” feature. This can very simply be done with
$_SERVER['HTTP_USER_AGENT']
Facebook sends a special “facebook” useragent when crawling the site.
So to catch facebook, and show special stuff you could do
if(preg_match('/facebook/', $_SERVER['HTTP_USER_AGENT'])
{
//show stuff to facebook
}
No Comments »
No comments yet.
Leave a comment