How to recognize Facebook User-Agent

后端 未结 11 1359
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 15:35

When sharing one of my pages on FB, I want to display something different. Problem is, I prefer not to use the og: elements, but to recognize FB user-agent.

What is

11条回答
  •  感情败类
    2020-11-27 15:56

    "Facebook's user-agent string is facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)..."

    Hi

    Small, yet important, correction -> Facebook external hit uses 2 different user agents:

    facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)
    facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php) 
    

    Setting you fitler to 1.1 only may cause filtering issues with 1.0 version.

    For more information about Facebook Bot (and other bots) please refer to Botopedia.org - a Comunity-Sourced bot directory, powered by Incapsula.

    Besides user-agent data, the directory also offers an IP verification option, allowing you to cross-verify an IP/User-Agent, thus helping to prevent impersonation attempts.

提交回复
热议问题