diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-05-21 03:20:52 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-05-21 03:20:52 +0400 |
commit | 548c958b16fbb1acd2e08f306742efeed36016bf (patch) | |
tree | f009511b87cb05fe5097825b85ee0e777d77cae2 | |
parent | 7183d210291c8a2cc8f27231fb7f7bdb7055a16a (diff) | |
parent | 42bcc84c3100ab25ed5e1f14b41d5e3f3235bf85 (diff) |
Merge remote-tracking branch 'origin/master'
Conflicts:
plugins/Installation/ServerFilesGenerator.php
15 files changed, 103 insertions, 5 deletions
diff --git a/core/DataFiles/SearchEngines.php b/core/DataFiles/SearchEngines.php index 03209af231..ed1ebdedc5 100644 --- a/core/DataFiles/SearchEngines.php +++ b/core/DataFiles/SearchEngines.php @@ -86,6 +86,9 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { // Acoon 'www.acoon.de' => array('Acoon', 'begriff', 'cgi-bin/search.exe?begriff={k}'), + // Aguea + 'chercherfr.aguea.com' => array('Aguea', 'q', 's.py?q={k}'), + // Alexa 'alexa.com' => array('Alexa', 'q', 'search?q={k}'), 'search.toolbars.alexa.com' => array('Alexa'), @@ -183,15 +186,19 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { '{}.search.ask.com' => array('Ask'), 'avira-int.ask.com' => array('Ask'), 'searchqu.com' => array('Ask'), + 'search.tb.ask.com' => array('Ask'), // Atlas 'searchatlas.centrum.cz' => array('Atlas', 'q', '?q={k}'), + // auone + 'search.auone.jp' => array('auone', 'q', '?q={k}'), + // Austronaut 'www2.austronaut.at' => array('Austronaut', 'q'), 'www1.austronaut.at' => array('Austronaut'), - // Babylon (Enhanced by Google) + // Babylon (Enhanced by Google), 'search.babylon.com' => array('Babylon', array('q', '/\/web\/(.*)/'), '?q={k}'), 'searchassist.babylon.com' => array('Babylon'), @@ -205,6 +212,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { // Biglobe 'cgi.search.biglobe.ne.jp' => array('Biglobe', 'q', 'cgi-bin/search-st?q={k}'), + 'images.search.biglobe.ne.jp' => array('Biglobe Images', 'q', 'cgi-bin/search-st?q={k}'), // Bing 'bing.com' => array('Bing', array('q', 'Q'), 'search?q={k}'), @@ -440,6 +448,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { '{}.wow.com' => array('Google'), 'search.leonardo.it' => array('Google'), 'www.optuszoo.com.au' => array('Google'), + 'search.dolphin-browser.jp' => array('Google'), 'search.smt.docomo.ne.jp' => array('Google', 'MT'), 'image.search.smt.docomo.ne.jp' => array('Google', 'MT'), @@ -617,6 +626,9 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { 'www.toile.com' => array('La Toile Du Québec (Google)', 'q', 'search?q={k}'), 'web.toile.com' => array('La Toile Du Québec (Google)'), + // LookAny + 'www.lookany.com' => array('LookAny', '/(?:search|images|videos)\/([^\/]+)/'), + // Looksmart 'www.looksmart.com' => array('Looksmart', 'key'), @@ -699,7 +711,8 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { 'www.neti.ee' => array('Neti', 'query', 'cgi-bin/otsing?query={k}', 'iso-8859-1'), // Nifty - 'search.nifty.com' => array('Nifty', 'q', 'websearch/search?q={k}'), + 'search.nifty.com' => array('Nifty', array('q', 'Text'), 'websearch/search?q={k}'), + 'videosearch.nifty.com' => array('Nifty Videos', 'kw', 'search?kw={k}'), // Nigma 'nigma.ru' => array('Nigma', 's', 'index.php?s={k}'), @@ -803,6 +816,13 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { // Snap.do 'search.snap.do' => array('Snap.do', 'q', '?q={k}'), + // SeeSaa + 'search.seesaa.jp' => array('SeeSaa', '/\/([^\/]+)\/index\.html/', '{k}/index.html'), + + // So-net + 'www.so-net.ne.jp' => array('So-net', 'query', 'search/web/?query={k}'), + 'video.so-net.ne.jp' => array('So-net Videos', 'kw', 'search/?kw={k}'), + // Sogou 'www.sogou.com' => array('Sogou', 'query', 'web?query={k}', 'gb2312'), @@ -937,12 +957,22 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { // Wirtualna Polska 'szukaj.wp.pl' => array('Wirtualna Polska', 'szukaj', 'http://szukaj.wp.pl/szukaj.html?szukaj={k}'), + // Woopie + 'www.woopie.jp' => array('Woopie', 'kw', 'search?kw={k}'), + // WWW 'search.www.ee' => array('www värav', 'query'), // X-recherche 'www.x-recherche.com' => array('X-Recherche', 'MOTS', 'cgi-bin/websearch?MOTS={k}'), + // Yahoo! Japan + 'search.yahoo.co.jp' => array('Yahoo! Japan', 'p', 'search?p={k}'), + 'jp.hao123.com' => array('Yahoo! Japan', 'query'), + 'video.search.yahoo.co.jp' => array('Yahoo! Japan Videos', 'p', 'search?p={k}'), + 'image.search.yahoo.co.jp' => array('Yahoo! Japan Images', 'p', 'search?p={k}'), + + // Yahoo 'search.yahoo.com' => array('Yahoo!', array('p', 'q'), 'search?p={k}'), // '*.search.yahoo.com' => array('Yahoo!'), // see built-in helper in Common.php @@ -953,8 +983,6 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) { 'espanol.yahoo.com' => array('Yahoo!'), 'qc.yahoo.com' => array('Yahoo!'), 'one.cn.yahoo.com' => array('Yahoo!'), - 'video.search.yahoo.co.jp' => array('Yahoo!'), - 'image.search.yahoo.co.jp' => array('Yahoo!'), // Powered by Yahoo APIs 'www.cercato.it' => array('Yahoo!', 'q'), diff --git a/core/UrlHelper.php b/core/UrlHelper.php index 2ce26ba165..b99f457f40 100644 --- a/core/UrlHelper.php +++ b/core/UrlHelper.php @@ -286,8 +286,18 @@ class UrlHelper $searchEngines = Common::getSearchEngineUrls(); $hostPattern = self::getLossyUrl($referrerHost); + /* + * Try to get the best matching 'host' in definitions + * 1. check if host + path matches an definition + * 2. check if host only matches + * 3. check if host pattern + path matches + * 4. check if host pattern matches + * 5. special handling + */ if (array_key_exists($referrerHost . $referrerPath, $searchEngines)) { $referrerHost = $referrerHost . $referrerPath; + } elseif (array_key_exists($referrerHost, $searchEngines)) { + // no need to change host } elseif (array_key_exists($hostPattern . $referrerPath, $searchEngines)) { $referrerHost = $hostPattern . $referrerPath; } elseif (array_key_exists($hostPattern, $searchEngines)) { diff --git a/plugins/Referrers/images/searchEngines/chercherfr.aguea.com.png b/plugins/Referrers/images/searchEngines/chercherfr.aguea.com.png Binary files differnew file mode 100644 index 0000000000..c256f96217 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/chercherfr.aguea.com.png diff --git a/plugins/Referrers/images/searchEngines/image.search.yahoo.co.jp.png b/plugins/Referrers/images/searchEngines/image.search.yahoo.co.jp.png Binary files differnew file mode 100644 index 0000000000..1077fb3d89 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/image.search.yahoo.co.jp.png diff --git a/plugins/Referrers/images/searchEngines/images.search.biglobe.ne.jp.png b/plugins/Referrers/images/searchEngines/images.search.biglobe.ne.jp.png Binary files differnew file mode 100644 index 0000000000..dda8e8a489 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/images.search.biglobe.ne.jp.png diff --git a/plugins/Referrers/images/searchEngines/search.auone.jp.png b/plugins/Referrers/images/searchEngines/search.auone.jp.png Binary files differnew file mode 100644 index 0000000000..e3197e0cc6 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/search.auone.jp.png diff --git a/plugins/Referrers/images/searchEngines/search.seesaa.jp.png b/plugins/Referrers/images/searchEngines/search.seesaa.jp.png Binary files differnew file mode 100644 index 0000000000..3bdebea72b --- /dev/null +++ b/plugins/Referrers/images/searchEngines/search.seesaa.jp.png diff --git a/plugins/Referrers/images/searchEngines/search.yahoo.co.jp.png b/plugins/Referrers/images/searchEngines/search.yahoo.co.jp.png Binary files differnew file mode 100644 index 0000000000..1077fb3d89 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/search.yahoo.co.jp.png diff --git a/plugins/Referrers/images/searchEngines/video.search.yahoo.co.jp.png b/plugins/Referrers/images/searchEngines/video.search.yahoo.co.jp.png Binary files differnew file mode 100644 index 0000000000..1077fb3d89 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/video.search.yahoo.co.jp.png diff --git a/plugins/Referrers/images/searchEngines/video.so-net.ne.jp.png b/plugins/Referrers/images/searchEngines/video.so-net.ne.jp.png Binary files differnew file mode 100644 index 0000000000..6b071e50fd --- /dev/null +++ b/plugins/Referrers/images/searchEngines/video.so-net.ne.jp.png diff --git a/plugins/Referrers/images/searchEngines/videosearch.nifty.com.png b/plugins/Referrers/images/searchEngines/videosearch.nifty.com.png Binary files differnew file mode 100644 index 0000000000..6e76348780 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/videosearch.nifty.com.png diff --git a/plugins/Referrers/images/searchEngines/www.lookany.com.png b/plugins/Referrers/images/searchEngines/www.lookany.com.png Binary files differnew file mode 100644 index 0000000000..13940a1186 --- /dev/null +++ b/plugins/Referrers/images/searchEngines/www.lookany.com.png diff --git a/plugins/Referrers/images/searchEngines/www.so-net.ne.jp.png b/plugins/Referrers/images/searchEngines/www.so-net.ne.jp.png Binary files differnew file mode 100644 index 0000000000..6b071e50fd --- /dev/null +++ b/plugins/Referrers/images/searchEngines/www.so-net.ne.jp.png diff --git a/plugins/Referrers/images/searchEngines/www.woopie.jp.png b/plugins/Referrers/images/searchEngines/www.woopie.jp.png Binary files differnew file mode 100644 index 0000000000..ef3b7ecd9e --- /dev/null +++ b/plugins/Referrers/images/searchEngines/www.woopie.jp.png diff --git a/tests/resources/extractSearchEngineInformationFromUrlTests.yml b/tests/resources/extractSearchEngineInformationFromUrlTests.yml index 84cde86512..f7e9c04d64 100644 --- a/tests/resources/extractSearchEngineInformationFromUrlTests.yml +++ b/tests/resources/extractSearchEngineInformationFromUrlTests.yml @@ -379,9 +379,29 @@ keywords: 'searchterm' - url: 'http://image.search.yahoo.co.jp/search?ei=UTF-8&fr=top_ga1_sa&p=%EF%BD%94%EF%BD%8F+%EF%BD%88%EF%BD%85%EF%BD%81%EF%BD%92%EF%BD%94+%EF%BD%8C%EF%BD%8F%EF%BD%87%EF%BD%8F' - engine: 'Yahoo!' + engine: 'Yahoo! Japan Images' keywords: 'to heart logo' +- url: 'http://video.search.yahoo.co.jp/search?tt=c&ei=UTF-8&fr=sfp_as&aq=-1&oq=&p=piwik&meta=vc%3D' + engine: 'Yahoo! Japan Videos' + keywords: 'piwik' + +- url: 'http://search.yahoo.co.jp/search?ei=UTF-8&p=piwik' + engine: 'Yahoo! Japan' + keywords: 'piwik' + +- url: 'http://search.auone.jp/?q=piwik&sr=0001&ie=UTF-8&lr=' + engine: 'auone' + keywords: 'piwik' + +- url: 'http://search.nifty.com/websearch/search?select=2&ss=up&cflg=%E6%A4%9C%E7%B4%A2&chartype=&Text=%E3%82%A6%E3%82%A7%E3%83%96%E6%A4%9C%E7%B4%A2%E7%B5%90%E6%9E%9C%E7%B4%84' + engine: 'Nifty' + keywords: 'ウェブ検索結果約' + +- url: 'http://videosearch.nifty.com/search?kw=piwik' + engine: 'Nifty Videos' + keywords: 'piwik' + - url: 'http://www.claro-search.com/?q=logiciels+pour+%C3%A9crire+en+japonais+avec+windows+xp&s=web&as=0&rlz=0&babsrc=SP_clro' engine: 'Claro Search' keywords: 'logiciels pour écrire en japonais avec windows xp' @@ -394,10 +414,50 @@ engine: 'Google' keywords: 'ふたりはプリキュアmaxheart' +- url: 'http://cgi.search.biglobe.ne.jp/cgi-bin/search-st?search=%E6%A4%9C%E7%B4%A2&web_s.x=1&q=piwik&x=0&y=0&ie=utf8' + engine: 'Biglobe' + keywords: 'piwik' + +- url: 'http://images.search.biglobe.ne.jp/cgi-bin/search?q=%E3%82%B5%E3%83%BC%E3%83%AA%E3%83%B3%E3%82%AF%EF%BC%88' + engine: 'Biglobe Images' + keywords: 'サーリンク(' + +- url: 'http://www.so-net.ne.jp/search/web/?query=piwik&from=gp&kz=&suggest=gp_suggest_on' + engine: 'So-net' + keywords: 'piwik' + +- url: 'http://video.so-net.ne.jp/search/?kw=piwik&from=' + engine: 'So-net Videos' + keywords: 'piwik' + +- url: 'http://search.seesaa.jp/%E6%97%A5%E6%9C%AC%E3%83%86%E3%83%AC%E3%83%93%E6%94%BE%E9%80%81%E7%B6%B2/index.html' + engine: 'SeeSaa' + keywords: '日本テレビ放送網' + +- url: 'http://chercherfr.aguea.com/s.py?q=piwik' + engine: 'Aguea' + keywords: 'piwik' + +- url: 'http://www.lookany.com/search/piwik+guide' + engine: 'LookAny' + keywords: 'piwik guide' + +- url: 'http://www.lookany.com/images/piwik+guide' + engine: 'LookAny' + keywords: 'piwik guide' + +- url: 'http://search.tb.ask.com/search/GGmain.jhtml?searchfor=Drinkable+sunscreen&tpr=tt-pop-h&n=&st=hp&qs=' + engine: 'Ask' + keywords: 'drinkable sunscreen' + - url: 'http://search.smartaddressbar.com/web.php?s=habillage+aikatsu' engine: 'SmartAddressbar' keywords: 'habillage aikatsu' +- url: 'http://www.woopie.jp/search?kw=piwik&return=authorization&res=fail&code=213' + engine: 'Woopie' + keywords: 'piwik' + - url: 'http://lemoteur.ke.voila.fr/?module=orange&bhv=images&kw=negi%20ma%20ala%20alba%20eva' engine: 'Orange' keywords: 'negi ma ala alba eva' |