add yandex support to web-search plugin

This commit is contained in:
Anton Ivanov 2014-09-11 13:45:35 +04:00
commit 9b6a6af130

View file

@ -10,7 +10,7 @@ function web_search() {
fi fi
# check whether the search engine is supported # check whether the search engine is supported
if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo)' ]]; if [[ ! $1 =~ '(google|bing|yahoo|duckduckgo|yandex)' ]];
then then
echo "Search engine $1 not supported." echo "Search engine $1 not supported."
return 1 return 1
@ -26,6 +26,8 @@ function web_search() {
if [[ $1 == 'duckduckgo' ]]; then if [[ $1 == 'duckduckgo' ]]; then
#slightly different search syntax for DDG #slightly different search syntax for DDG
url="${url}/?q=" url="${url}/?q="
elif [[ $1 == 'yandex' ]]; then
url="http://yandex.ru/yandsearch?text="
else else
url="${url}/search?q=" url="${url}/search?q="
fi fi
@ -44,6 +46,8 @@ function web_search() {
alias bing='web_search bing' alias bing='web_search bing'
alias google='web_search google' alias google='web_search google'
alias yandex='web_search yandex'
alias ya='web_search yandex'
alias yahoo='web_search yahoo' alias yahoo='web_search yahoo'
alias ddg='web_search duckduckgo' alias ddg='web_search duckduckgo'
#add your own !bang searches here #add your own !bang searches here