Catching facebook
Showing special content to the facebook crawler, when using the "share on facebook" feature.
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 [sourcecode lang="php"] $_SERVER['HTTP_USER_AGENT'] [/sourcecode] Facebook sends a special "facebook" useragent when crawling the site.
So to catch facebook, and show special stuff you could do [sourcecode lang="php"] if(preg_match('/facebook/', $_SERVER['HTTP_USER_AGENT']) { //show stuff to facebook } [/sourcecode]
Folk siger