是否有在线用户代理数据库? [英] Is there an online user agent database?
问题描述
你如何解析你的用户代理字符串?我希望得到:
How do you parse your user agent strings? I'm looking to get:
- 浏览器
- 浏览器版本
- 操作系统
- 操作系统版本
来自用户代理字符串.我的应用程序是用 perl 编写的,之前使用的是 HTTP::BrowserDetect.它有点过时了,不再维护.(它已经更新了.)我与使用 perl 进行实际查找没有任何关系.
from a user agent string. My app is written in perl and was previously using HTTP::BrowserDetect. It's a bit dated and is no longer maintained. ( it's since been updated.) I'm in no way tied to using perl for the actual lookup.
我得出的结论是自动解析是一个失败的原因.我正在考虑编写一个 crud 类型的应用程序,向我展示未分类的 UA 列表并手动使它们保持最新.
I've come to the conclusion that automagic parsing is a lost cause. I was thinking of writing a crud type app to show me a list of unclassified UA's and manually keep them up to date.
这样的资源是否已经存在,我可以利用?如果我可以进行 HTTP 调用来查找用户代理信息,那就太棒了.
Does such an resource already exist that I can tap into? It would be awesome if I could make an HTTP call to look up the user agent info.
谢谢!
推荐答案
useragentstring.com 具有其用户代理字符串的浏览器和操作系统信息.还有一个分析"框来提交您自己的字符串.我不知道自动连接起来有多容易,但它似乎有你想要的那种信息.
useragentstring.com has browser and OS information for its user agent strings. There's also an 'analyze' box to submit your own string. I don't know how easy it is to hook up to automatically, but it seems to have the sort of info you want.
从原始帖子更新(不想窃取您的赞成票):
我从 http://useragentstring.com/ 的作者那里得到了这个:
I got this back from the author of http://useragentstring.com/:
我有一个简单的 API,但我即将重新编码我的很多网站,所以它可能在不久的将来改变.如果你链接到我的网站,你可以发送一个表单字段中的 useragentstring 或名为uas"的查询字符串:
I have a simple API, but I'm about to recode a lot of my site, so it might change in the near future. If you link to my site, you can send a useragentstring in a form field or in the querystring with the name 'uas':
http://www.useragentstring.com/?uas=Opera/9.70%20(Linux%20i686%20;%20U;%20en-us)%20Presto/2.2.0
这将自动解析细绳.如果添加 &getText=all
this will automaticly parse the string. if you add &getText=all
你会得到一个带有密钥的文本文件值对像agent_type=浏览器;agent_name=Opera;agent_version=9.70...
you will get a text file with key value pairs like agent_type=Browser;agent_name=Opera;agent_version=9.70...
这篇关于是否有在线用户代理数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!