Posted by Philip Hallstrom on 08/24/05 19:15
> I've done a google and can't find anything on this.
>
> I want to parse a long list of useragent strings for a web analysis script I
> am writing. I could use get_browser, but firstly this would slow down my
> script quite a bit and secondly I am relying on the browscap.ini file of the
> newness of which is upto my ISP as I am on shared hosting. Is there are a
> way of doing this?
>
> I'd like to break down the string into it's componant parts but the
> difference in strings is big. eg-
>
> Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; stumbleupon.com 1.927)
>
> Windows-Media-Player/10.00.00.3650
>
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511
> Firefox/1.0.4
>
> Mozilla/5.0 (compatible; Yahoo! Slurp;
> http://help.yahoo.com/help/us/ysearch/slurp)
>
> Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/312.1 (KHTML,
> like Gecko) Safari/312
>
> How do I start with this one?
Depending on your license, take a look at the code for webalyzer or
awstats or some other package and see how they do it.
-philip
[Back to original message]
|