1 2 3 4 5 6 7 8
require HTTP::DetectUserAgent; my $ua = HTTP::DetectUserAgent->new($HTTP_USER_AGENT); my $type = $ua->type; if($type eq "Browser"){ $browser_type = $ua->name; $browser_version = $ua->version; $search_bot = 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use strict; use warnings; use 5.010; my %ua = ( Opera_1216 => 'Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.16', Firefox_24 => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0', IE_10 => 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Win64; x64; Trident/6.0)', Opera_18 => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.8 Safari/537.36 OPR/18.0.1284.5 (Edition Developer)' ); require HTTP::DetectUserAgent; for my $k (keys %ua) { my $ua = HTTP::DetectUserAgent->new($ua{$k}) or die; say "$k: ",$ua->type, " ",$ua->name; }
1
2
3
4
5
6
7
8
9
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; BRI/2; .NET4.0E; MALC) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; MAAU; MAAU) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; MAAU; MAAU) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; Avant Browser) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0; MAAU; MAAU) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; MALC) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; NP06) -> Internet Explorer
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0) -> Internet Explorer
2013-10-19T15:34:12 GwenDragonAktuelle Firefox 24 und IE 10.
2013-10-19T14:18:17 GwenDragonWofür brauchst du das Modul?
2013-10-19T13:09:40 Gustlherauszufinden ob der Besucher ein searchbot ist oder nicht?