How to identify a Facebook bot?

泪湿孤枕 提交于 2019-12-11 02:39:55

问题


is there a way to reliably identify a facebook bot by IP?

My site is getting hammered by bots claiming to be facebook, but how do I know for sure? I'm looking for some kind of official procedure to validate a facebook bot similar to what Google recommends for their bots here.

Can I perhaps parse OrgName in whois and trust that? Or can that be fake?


回答1:


I'm answering this for the sake of keyword indexing in the internets.

Indeed, it looks like the best way to identify a Facebook bot (Facebook Scraper) is by matching IP to the range of declared official Facebook IP ranges that can be acquired by running

whois -h whois.radb.net '!gAS32934'



回答2:


Why don't you just check the user-agent, such as

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

instead of IP?



来源:https://stackoverflow.com/questions/11881609/how-to-identify-a-facebook-bot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!