实用脚本:电影信息查询、货币转换、比特币地址查询及网页变更跟踪
在互联网应用中,有许多实用的脚本可以帮助我们自动化完成一些常见任务,例如查询电影信息、进行货币转换、获取比特币地址信息以及跟踪网页变更等。下面将为大家详细介绍这些实用脚本。
1. moviedata 脚本:查询电影信息
- 代码实现
# 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 class="findHeader">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 class="findHeader">Displaying' $tempout)" ] ; then
grep --color=never '/title/tt' $tempout | \
sed 's/</\
<
超级会员免费看
订阅专栏 解锁全文
1万+

被折叠的 条评论
为什么被折叠?



