You are not logged in Log in Join
You are here: Home » Members » svenasse » UserSniffer

Log in
Name

Password

 
 

Folder icon UserSniffer

Returns client info based upon REMOTE_USER_AGENT

UserSniffer is based upon the PHP3 script written by Roger Raymond.  You can find the original PHP3 script at http://phpclasses.upperdesign.com/browse.html/package/81.

UserSniffer exposes the following tags:

  • browser - Browser Name (Netscape, IE, Opera, iCab, Lynx, Konqueror, Unknown)
  • version - Browser Full Version
  • majorver - Browser Major Version
  • minorver - Browser Minor Version
  • aol - True/False
  • webtv - True/False
  • lynx - True/False
  • konqueror - True/False
  • javascript - Assumed JavaScript Version Supported by Browser
  • platform - System Platform (Win16,Win32,Mac,OS2,Unix)
  • os - System OS (Win98,OS2,Mac68k,linux,bsd,etc...) see code
  • ip - Client IP Address
  • languages - Dictionary

Installation Notes

  • Extract tgz file into the Zope directory, or the zip file into the Extensions directory.
  • Add a new External Method to your Zope web space
    • ID: UserSniffer
    • Function Name: UserSniffer
    • Python Module: UserSniffer
  • Set a variable to the result of the UserSniffer:
    <dtml-call "REQUEST.set( sniffer, UserSniffer() )">
  • Access each of the variables through the "sniffer" dictionary:
    <dtml-var "sniffer[ browser ]">

Changes since 1.2:

  • Changed order of Opera and Konqueror so that they are not confused with IE and Netscape respectively
  • Modified OS logic so that default is "Unknown" and not "Win9xNT"
  • Tested and verified results with over 3,000 different User-Agent strings

Changes since 1.1:

  • added detection of Lynx and Konqueror browsers and two new variables: lynx & konqueror
  • changed detection of browser version so that it won't crash if there is a letter in the version
  • added dictionary of acceptable languages by the browser in the languages tag.  Returns a dictionary of ['Unknown'] if the browser didn't send any languages

 Title   Type   Size   Modified   Status 
 1.21 Edit object Software Release   2001-07-15 published