实用脚本:电影信息查询、货币换算、比特币地址查询及网页变更跟踪
在网络和互联网应用中,我们常常会遇到需要查询特定信息、进行数据转换或跟踪网页变化等需求。下面将为大家介绍几个实用的脚本,它们可以帮助我们更高效地完成这些任务。
1. moviedata 脚本:电影信息查询
这个脚本可以根据用户输入的电影标题或 IMDb ID 号来查询相关电影信息。
# It's not an IMDb title number, so let's go with the search... fixedname="$(echo $@ | tr ' ' '+')" # for the URL url="$imdburl$fixedname" lynx -source $imdburl$fixedname > $tempout # No results? fail="$(grep --color=never '<h1>No ' $tempout)" # If there's more than one matching title... if [ ! -z "$fail" ] ; then echo "Failed: no results found for $1" exit 1 elif [ ! -z "$(grep '<h1>Displaying' $tempout)" ] ; then grep --color=never '/title/tt' $tempout | \ sed 's/</\ </g' |