1*2d987c80SAndreas Gohr<?php 2*2d987c80SAndreas Gohr 3*2d987c80SAndreas Gohrnamespace dokuwiki\plugin\statistics; 4*2d987c80SAndreas Gohr 5*2d987c80SAndreas Gohr/** 6*2d987c80SAndreas Gohr * Defines regular expressions for the most common search engines 7*2d987c80SAndreas Gohr */ 8*2d987c80SAndreas Gohrclass SearchEngines 9*2d987c80SAndreas Gohr{ 10*2d987c80SAndreas Gohr 11*2d987c80SAndreas Gohr 12*2d987c80SAndreas Gohr protected $SEARCHENGINEINFO = [ 13*2d987c80SAndreas Gohr 'google' => ['Google', 'http://www.google.com'], 14*2d987c80SAndreas Gohr 'yahoo' => ['Yahoo!', 'http://www.yahoo.com'], 15*2d987c80SAndreas Gohr 'yandex' => ['Яндекс (Yandex)', 'http://www.yandex.ru'], 16*2d987c80SAndreas Gohr 'naver' => ['네이버 (Naver)', 'http://www.naver.com'], 17*2d987c80SAndreas Gohr 'baidu' => ['百度 (Baidu)', 'http://www.baidu.com'], 18*2d987c80SAndreas Gohr 'ask' => ['Ask', 'http://www.ask.com'], 19*2d987c80SAndreas Gohr 'babylon' => ['Babylon', 'http://search.babylon.com'], 20*2d987c80SAndreas Gohr 'aol' => ['AOL Search', 'http://search.aol.com'], 21*2d987c80SAndreas Gohr 'duckduckgo' => ['DuckDuckGo', 'http://duckduckgo.com'], 22*2d987c80SAndreas Gohr 'bing' => ['Bing', 'http://www.bing.com'] 23*2d987c80SAndreas Gohr ]; 24*2d987c80SAndreas Gohr 25*2d987c80SAndreas Gohr protected $SEARCHENGINES = ['^(\w+\.)*google(\.co)?\.([a-z]{2,5})$' => ['google', 'q'], 26*2d987c80SAndreas Gohr '^(\w+\.)*bing(\.co)?\.([a-z]{2,5})$' => ['bing', 'q'], 27*2d987c80SAndreas Gohr '^(\w+\.)*yandex(\.co)?\.([a-z]{2,5})$' => ['yandex', 'query'], 28*2d987c80SAndreas Gohr '^(\w+\.)*yahoo\.com$' => ['yahoo', 'p'], 29*2d987c80SAndreas Gohr '^search\.naver\.com$' => ['naver', 'query'], 30*2d987c80SAndreas Gohr '^(\w+\.)*baidu\.com$' => ['baidu', 'wd', 'word', 'kw'], 31*2d987c80SAndreas Gohr '^search\.avg\.com$' => ['google', 'q'], 32*2d987c80SAndreas Gohr '^(\w+\.)*ask\.com$' => ['ask', 'ask', 'q', 'searchfor'], 33*2d987c80SAndreas Gohr '^(\w+\.)*search-results\.com$' => ['ask', 'ask', 'q', 'searchfor'], 34*2d987c80SAndreas Gohr '^search\.babylon\.com$' => ['babylon', 'q'], 35*2d987c80SAndreas Gohr '^(\w+\.)*(aol)?((search|recherches?|images|suche|alicesuche)\.)aol(\.co)?\.([a-z]{2,5})$' => ['aol', 'query', 'q'], 36*2d987c80SAndreas Gohr '^duckduckgo\.com$' => ['duckduckgo', 'q']]; 37*2d987c80SAndreas Gohr 38*2d987c80SAndreas Gohr 39*2d987c80SAndreas Gohr public function __construct() 40*2d987c80SAndreas Gohr { 41*2d987c80SAndreas Gohr // add the internal DokuWiki search engine 42*2d987c80SAndreas Gohr 'dokuwiki' => ['DokuWiki Internal Search', wl()], 43*2d987c80SAndreas Gohr 44*2d987c80SAndreas Gohr 45*2d987c80SAndreas Gohr } 46*2d987c80SAndreas Gohr 47*2d987c80SAndreas Gohr} 48