Show
Ignore:
Timestamp:
11/01/09 01:57:34 (5 years ago)
Author:
mizuno_takaaki
Message:

add iphone/some crawlers

Location:
lang/perl/HTTP-DetectUserAgent/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-DetectUserAgent/trunk/lib/HTTP/DetectUserAgent.pm

    r20869 r35805  
    118118            $self->{name} = 'Yahoo! Japan Crawler'; 
    119119            $self->{vendor} = 'Yahoo'; 
     120        }elsif( index($ua, 'yahoofeedseeker') != -1){ 
     121            $self->{name} = 'YahooFeedSeeker'; 
     122            $self->{vendor} = 'Yahoo'; 
    120123        } 
    121124    }elsif( index($ua, 'msnbot') != -1){ 
     
    130133        # http://help.baidu.jp/system/05.html 
    131134        $self->{name} = 'Baiduspider'; 
     135        $self->{vendor} = 'Baidu'; 
     136    }elsif( index($ua, 'baidumobaider') != -1){ 
     137        # http://help.baidu.jp/system/05.html 
     138        $self->{name} = 'BaiduMobaider'; 
    132139        $self->{vendor} = 'Baidu'; 
    133140    }elsif( index($ua, 'yeti') != -1 && index($ua, 'naver') != -1){ 
     
    151158        $self->{name} = 'Internet Archive'; 
    152159        $self->{vendor} = 'Internet Archive'; 
    153  
     160    }elsif( index($ua, 'tagoobot') != -1){ 
     161        # http://www.tagoo.ru 
     162        $self->{name} = 'Tagoobot'; 
     163        $self->{vendor} = 'Tagoo'; 
     164    }elsif( index($ua, 'sogou web spider') != -1){ 
     165        #http://www.sogou.com/docs/help/webmasters.htm#07 
     166        $self->{name} = 'Sogou'; 
     167        $self->{vendor} = 'Sogou'; 
     168    }elsif( index($ua, 'daumoa') != -1){ 
     169        #http://ws.daum.net/aboutWebSearch.html 
     170        $self->{name} = 'Daumoa'; 
     171        $self->{vendor} = 'Daum'; 
    154172    }elsif( index($ua, 'spider') != -1 || index($ua, 'crawler') != -1 ){ 
    155173        $self->{name} = 'Unknown Crawler'; 
     
    424442    my ( $self, $ua ) = @_; 
    425443    return unless $ua; 
    426     if( $ua =~ /win(?:9[58]|dows|nt)/ ){ 
     444    if( $ua =~ /iphone/ ){ 
     445        $self->{os} = 'iPhone OS'; 
     446    }elsif( $ua =~ /win(?:9[58]|dows|nt)/ ){ 
    427447        $self->{os} = 'Windows'; 
    428448    }elsif( $ua =~ /mac(?:intosh|_(?:powerpc|68000))/ ){ 
  • lang/perl/HTTP-DetectUserAgent/trunk/t/01.browser.t

    r20327 r35805  
    4848name: "Internet Explorer" 
    4949version: "6.0" 
     50vendor: "Microsoft" 
     51os: "Windows" 
     52 
     53=== Internet Explorer 3 
     54--- input 
     55Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 1.1.4322)  
     56--- expected 
     57name: "Internet Explorer" 
     58version: "8.0" 
    5059vendor: "Microsoft" 
    5160os: "Windows" 
     
    105114os: "Windows" 
    106115 
     116=== iPhone 
     117--- input 
     118Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0_1 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A400 Safari/528.16 
     119--- expected 
     120name: "Safari" 
     121version: "4.0" 
     122vendor: "Apple" 
     123os: "iPhone OS" 
    107124 
  • lang/perl/HTTP-DetectUserAgent/trunk/t/03.crawler.t

    r20327 r35805  
    2929vendor: "Google" 
    3030 
    31 === googlebot mobile 
     31=== googlebot mobile 1 
    3232--- input 
    3333DoCoMo/1.0/N505i/c20/TB/W20H10 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html) 
     34--- expected 
     35name: "Googlebot Mobile" 
     36vendor: "Google" 
     37 
     38=== googlebot mobile 2 
     39--- input 
     40DoCoMo/2.0 N905i(c100;TB;W24H16) (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)  
    3441--- expected 
    3542name: "Googlebot Mobile" 
     
    6370name: "Twiceler" 
    6471vendor: "Cuil" 
     72 
     73=== BaiduMobaider 1 
     74--- input 
     75DoCoMo/2.0 P05A(c100;TB;W24H15) (compatible; BaiduMobaider/1.0; +http://www.baidu.jp/spider/) 
     76--- expected 
     77name: "BaiduMobaider" 
     78vendor: "Baidu" 
     79 
     80=== BaiduMobaider 2 
     81--- input 
     82DoCoMo/1.0/D506i/c20/TB/W20H10 (compatible; BaiduMobaider/1.0; +http://www.baidu.jp/spider/) 
     83--- expected 
     84name: "BaiduMobaider" 
     85vendor: "Baidu" 
     86 
     87=== BaiduMobaider 3 
     88--- input 
     89KDDI-CA3A UP.Browser/6.2.0.13.2 (GUI) MMP/2.0 (compatible; BaiduMobaider/1.0;+http://www.baidu.jp/spider/) 
     90--- expected 
     91name: "BaiduMobaider" 
     92vendor: "Baidu" 
     93 
     94=== BaiduMobaider 4 
     95--- input 
     96SoftBank/1.0/912SH/SHJ002/SN001111111111000 Browser/NetFront/3.4 Profile/MIDP-2.0 (compatible; BaiduMobaider/1.0;+http://www.baidu.jp/spider/) 
     97--- expected 
     98name: "BaiduMobaider" 
     99vendor: "Baidu" 
     100 
     101=== Tagoobot 
     102--- input 
     103Mozilla/5.0 (compatible; Tagoobot/3.0; +http://www.tagoo.ru) 
     104--- expected 
     105name: "Tagoobot" 
     106vendor: "Tagoo" 
     107 
     108=== Sogou web spider 
     109--- input 
     110Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07) 
     111--- expected 
     112name: "Sogou" 
     113vendor: "Sogou" 
     114 
     115=== Daumoa 
     116--- input 
     117Mozilla/5.0 (compatible; MSIE or Firefox mutant; not on Windows server; +http://ws.daum.net/aboutWebSearch.html) Daumoa/2.0 
     118--- expected 
     119name: "Daumoa" 
     120vendor: "Daum" 
     121 
     122=== YahooFeedSeeker 
     123--- input 
     124YahooFeedSeeker/1.0 (compatible; Mozilla 4.0; MSIE 5.5; http://my.yahoo.com/s/publishers.html) 
     125--- expected 
     126name: "YahooFeedSeeker" 
     127vendor: "Yahoo"