Forum Moderators: coopster & phranque

Message Too Old, No Replies

*Simple - Just want to detect UA with spaces!

         

JAB Creations

9:24 am on Dec 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just want to detect user agents with spaces...

The perl script I have (awstats) only does this with msie and netscape, here is the string...

my $regvermsie=qr/msie([+_ ]¦)([\d\.]*)/i;
my $regvernetscape=qr/netscape.?\/([\d\.]*)/i;
my $regvermozilla=qr/mozilla(\/¦)([\d\.]*)/i;

In the browser library file IE and netscape can be added to be detected as so...

'netscape7.0',
'netscape6.2.3',
'netscape6.2.2',
'netscape6.2.1',
'netscape6.2',
'msie6.0',
'msie5.5',
'msie5.23',

The user agents I am trying to detect are AOL and MSN... but more specifically their version numbers.

Example...

; AOL 9.0;

; AOL 8.0;

; MSN 9.0;

By default we're supposed to do this...

'aol_9.0',

But this isn't working for anyhting other then MSIE and netscape...

So now I need to figure out how to use perl to add those spaces in the detection strings.

When I look at the aw logs I see no UA's listed with spaces...

This is how the script reads the log...

UA--> Hits

msie6.0 26120
netscape4.04 1
netscape4.51 163
netscape7.0 33

So can anyone help me! I know this has got to be simpler then it seems!

volatilegx

3:33 am on Dec 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe something like:

[pre]
my $regverAOL=qr/AOL[?¦_?](\/¦)([\d\.]*)/i;
[/pre]

(the board is messing with my code. there should be a "space" before the first question mark)

JAB Creations

5:09 pm on Dec 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, actually I have it working now.

I have MSN, AOL, and some other stuff detecting now that I was having a be-zatch getting to detect.

I can't detect crazy browser with auccreacy yet though. Since there are three parts with two spaces.