gpt4 book ai didi

web-services - 是否有在线用户代理数据库?

转载 作者:行者123 更新时间:2023-12-03 07:41:21 25 4
gpt4 key购买 nike

如何解析用户代理字符串?我希望得到:

  • 浏览器
  • 浏览器版本
  • 操作系统
  • 操作系统版本

来自用户代理字符串。我的应用程序是用 perl 编写的,之前使用 HTTP::BrowserDetect 。它有点过时并且不再维护。 (编辑:此后已更新。)我决不依赖于使用 perl 进行实际查找。

我得出的结论是自动解析是一个失败的原因。我正在考虑编写一个 CRUD 类型的应用程序来向我显示未分类的 UA 列表并手动使它们保持最新。

是否已经存在可供我利用的资源?如果我可以进行 HTTP 调用来查找用户代理信息,那就太棒了。

谢谢!

最佳答案

useragentstring.com具有其用户代理字符串的浏览器和操作系统信息。还有一个“分析”框可以提交您自己的字符串。我不知道自动连接有多容易,但它似乎有您想要的信息。

原始帖子的更新(不想窃取您的赞成票):

我从http://useragentstring.com/的作者那里得到了这个:

I have a simple API, but I'm about torecode a lot of my site, so it mightchange in the near future. If you linkto my site, you can send auseragentstring in a form field or inthe querystring with the name 'uas':

http://www.useragentstring.com/?uas=Opera/9.70%20(Linux%20i686%20;%20U;%20en-us)%20Presto/2.2.0

this will automatically parse thestring. if you add &getText=all

http://www.useragentstring.com/?uas=Opera/9.70%20(Linux%20i686%20;%20U;%20en-us)%20Presto/2.2.0&getText=all

you will get a text file with keyvalue pairs likeagent_type=Browser;agent_name=Opera;agent_version=9.70...

关于web-services - 是否有在线用户代理数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1457380/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com