Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: detecting Alexa toolbar

by lithron (Chaplain)
on Oct 04, 2004 at 23:19 UTC ( #396433=note: print w/ replies, xml ) Need Help??


in reply to detecting Alexa toolbar

Check the environment variables set by your web server. The Alexa toolbar changes the browser version string. An example : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Alexa Toolbar)"

if ($ENV{HTTP_USER_AGENT} =~ /Alexa/) { print "$ENV{HTTP_USER_AGENT}"; }

The %ENV hash holds all the environment variables. The Apache web server (and I assume others) set the HTTP_USER_AGENT string equal to what the web browser sends, so that you can detect what version of Internet Explorer, Netscape Navigator, or Mozilla Firefox someone is running. In this case, Alexa also changes this string to include itself.


Comment on Re: detecting Alexa toolbar
Download Code
Re^2: detecting Alexa toolbar
by jonnyfolk (Vicar) on Oct 05, 2004 at 05:10 UTC
    That worked perfectly, Thank you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://396433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-07-31 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls