31733e08 |
1 | <?php |
2 | class userAgent { |
3 | // userAgent PHP class |
4 | // get user agent and tell us what Browser is accessing |
5 | // |
1defa974 |
6 | // function userAgent([$ua_string]) |
7 | // CONSTRUCTOR; reads UA string (or takes the optional given UA string) and gets info from that into our variables. |
31733e08 |
8 | // |
9 | // var $uastring |
10 | // the plain User Agent string |
11 | // var $brand |
12 | // returns the User Agent brand name |
13 | // var $version |
14 | // the User Agent version |
a8464009 |
15 | // var $bot |
16 | // bool: true if this agent is a bot |
f983aa36 |
17 | // var $uadata |
18 | // array of static user agent data (static vars in functions are set for all objects of this class!) |
31733e08 |
19 | // |
23585ba2 |
20 | // function getBrand() |
21 | // returns the User Agent Brand Name |
22 | // function getVersion() |
23 | // returns the User Agent version |
24 | // |
f983aa36 |
25 | // function getUAString() |
26 | // returns the full User Agent string |
27 | // |
a8464009 |
28 | // function isbot() |
29 | // returns true if User Agent seems to be a bot |
31733e08 |
30 | // function isns() |
31 | // returns true if User Agent seems to be Netscape brand, false if not |
32 | // function isns4() |
33 | // returns true if User Agent seems to be Netscape Communicator 4.x, false if not |
34 | // function isie() |
35 | // returns true if User Agent seems to be a version of Internet Exploder, false if not |
36 | // function geckobased() |
37 | // returns true if User Agent seems to be a Gecko-based browser, false if not |
38 | // function geckodate() |
39 | // returns the Gecko date when it's a Gecko-based browser, 0 if not |
1defa974 |
40 | // function khtmlbased() |
41 | // returns true if User Agent seems to be a KHTML-based browser, false if not |
42 | |
43 | // collection of some known User Agent Strings: |
44 | // Mozilla/5.0 (compatible; Konqueror/3; Linux 2.4.18; X11; i686) |
45 | // Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.3b) Gecko/20030114 |
46 | // Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt) |
47 | // Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90) |
48 | // Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) |
49 | // Mozilla/4.75 [de] (Win98; U) |
50 | // Opera/5.12 (Windows 2000; U) [de] |
51 | // Mozilla/5.0 (Windows; U; Win 9x 4.90; de-DE; m18) Gecko/20010131 Netscape6/6.01 |
52 | // Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.0.1) Gecko/20020823 Netscape/7.0 |
53 | // Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/51 (like Gecko) Safari/51 |
54 | // Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6g |
55 | // Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.1) Gecko/20021109 Chimera/0.6+ |
56 | // Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5 |
57 | // Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20021204 |
58 | // Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.05 [ja] |
59 | // Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC) OmniWeb/4.1.1-v424.6 |
23585ba2 |
60 | // Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6 |
61 | // Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1 |
a8464009 |
62 | // Python-urllib/1.15 |
63 | // *** search bots: *** |
f983aa36 |
64 | // W3C_Validator/1.305.2.12 libwww-perl/5.64 |
a8464009 |
65 | // Scooter/3.3 |
66 | // Spinne/2.0 med_AH |
67 | // Vagabondo/2.0 MT (webagent at wise-guys dot nl) |
68 | // TurnitinBot/1.5 ( ">http://www.turnitin.com/robot/crawlerinfo.html) |
69 | // FAST-WebCrawler/3.x Multimedia (mm dash crawler at fast dot no) |
70 | // Firefly/1.0 (compatible; Mozilla 4.0; MSIE 5.5) |
71 | // Googlebot/2.1 (+ ">http://www.googlebot.com/bot.html) |
72 | // Scrubby/2.2 ( ">http://www.scrubtheweb.com/) |
73 | // psbot/0.1 (+ ">http://www.picsearch.com/bot.html) |
74 | // NG/1.0 |
75 | // URL_Spider_Pro/3.0 ( ">http://www.innerprise.net/usp-spider.asp)" |
76 | // Pompos/1.3 ">http://dir.com/pompos.html |
77 | // Szukacz/1.5 (robot; www.szukacz.pl/jakdzialarobot.html; info@szukacz.pl) |
78 | // ASPseek/1.2.10 |
79 | // NPBot-1/2.0 |
80 | // NetResearchServer/2.7(loopimprovements.com/robot.html) |
81 | // dloader(NaverRobot)/1.0 |
82 | // Mozilla/4.0 compatible ZyBorg/1.0 Daily Refresh Beta-d03 (wn.zyborg@looksmart.net; |
83 | // Mozilla/2.0 (compatible; Ask Jeeves/Teoma) |
84 | // Mozilla/5.0 (Slurp/si; slurp@inktomi.com; ">http://www.inktomi.com/slurp.html) |
85 | // Mozilla/5.0 [en] (compatible; Gulper Web Bot 0.2.4 www.ecsl.cs.sunysb.edu/~maxim/cgi-bin/Link/GulperBot) |
86 | // Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; Girafabot; girafabot at girafa dot com; |
87 | // Mozilla/4.0 (efp@gmx.net) |
88 | // Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) |
89 | // PingALink Monitoring Services 1.0 (http://www.pingalink.com) |
90 | // IlTrovatore-Setaccio (+ ">http://www.iltrovatore.it) |
91 | // Mercator-2.0 |
92 | // appie 1.1 (www.walhello.com) |
93 | // larbin_2.6.2 (larbin2.6.2@unspecified.mail) |
94 | // OWR_Crawler 0.1 |
95 | // search.ch V1.4.2 (spiderman@search.ch; |
96 | // WebFilter Robot 1.0 |
97 | // Openfind data gatherer, Openbot/3.0+(robot-response@openfind.com.tw;+ |
98 | // LinkWalker |
99 | // Internet Explorer 5.5 |
100 | // BaiDuSpider |
101 | // Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T) |
102 | // B l i t z B O T @ t r i c u s . n e t (Mozilla compatible) |
103 | // sitecheck.internetseer.com (For more info see: ">http://sitecheck.internetseer.com) |
104 |