#!/bin/bash res=\
curl -s http://www.iciba.com/$1|grep 'class="prop"' -A 10|grep '<span>' |sed -e 's/<span>//g' -e 's/<.span>//g'|tee /dev/stderr`
if [[ $res == "" ]];then
if echo $1 |grep -q '[a-zA-Z ].';then
curl http://dict.youdao.com/w/eng/$1/#keyfrom=dict2.index 2>&1 | grep 'class="trans-container"' -A 10 |grep '<li'|sed "s/<li>//g"|sed "s/</li>//g"
else
curl http://dict.youdao.com/w/$1/#keyfrom=dict2.index 2>&1 | grep 'class="wordGroup"' -A10 |grep -o 'E2Ctranslation">.</a>'|grep -o '>[a-zA-Z ]+'|sed 's/>//g'
fi
fi`
网友评论