我们是做教诲的,希望大家能够学到知识,这个一贯是我们的初衷!
!
电影网站https://www.imdb.com,这个网站我自己登入上去看了看,确实可以登入,并不须要挂vpn,可惜的是英文。
由于代码太长了,我分屏了一下,大伙可以看行号码,不过我会把源码分享出去。

代码里用到了大量的sed和grep,这个sed我之前有分享,改天找个机会说说grep的利用。
写好了运行一下吧,在脚本后面lawrence of arabia是电影的名字。
你看吧!
出来一系列的电影了!
当然你的英文要好!
!
那我现在就分享一下代码吧!
!
#!/bin/bash#Date 2019-09-17PATH=/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH titleurl=\"大众http://www.imdb.com/title/tt\"大众imdburl=\"大众http://www.imdb.com/find?s=tt&exact=true&ref_=fn_tt_ex&q=\"大众tempout=\公众/tmp/moviedata.$$\"大众 summarize_film(){ grep \"大众<title>\"大众 $tempout | sed 's/<[^>]>//g;s/(more)//' grep --color=never -A2 '<h5>Plot:' $tempout | tail -1 |\ cut -d\ -f1 | fmt | sed 's/^/ /' exit 0}trap \"大众rm -f $tempout\"大众 0 1 15 if [ $# -eq 0 ] ; then echo \"大众Usage:$0 {movie title | movie ID}\"大众 >&2 exit 1fi###### nodigits=\"大众$(echo $1 | sed 's/[[:digit:]]//g')\公众 if [ $# -eq 1 -a -z \"大众$nodigits\"大众 ] ;then lynx -source \公众$titleurl$1/combined\"大众 > $tempout summarize_film exit 0fi######## fixedname=\"大众$(echo $@ | tr ' ' '+')\公众url=\"大众$imdburl$fixedname\"大众lynx -source $imdburl$fixedname > $tempout fail=\"大众$(grep --color --color=never '<h1 class=\"大众findHeader\公众>No ' $tempout)\公众 if [ ! -z \公众$fail\"大众 ] ;then echo \"大众Failed:no results foun for $1\"大众 exit 1elif [ ! -z \"大众$(grep '<h1 class=\"大众findHeader\公众>Displaying' $tempout)\"大众 ] ;then grep --color=never '/title/tt' $tempout | \ sed 's/</\ </g' | \ grep -vE '(.png|.jpg|>[ ]$)' |\ grep -A 1 \"大众a href=\"大众 | \ grep -v '^--$' | \ sed 's/<a href=\"大众\/title\/tt//g;s/<\/a>//' | \ awk '(NR %2 ==1){title=$0} (NR %2 ==0){print title \公众 \"大众 $0}' | \ sed 's/\/.>/: /'|\ sortfiexit 0
大家可以复制下来运行一下,不懂的话直接私信
我们是做教诲的,希望大家能够学到知识,这个一贯是我们的初衷!
!
记住噢,加群谈论噢,不懂的可以问,也有人回答的。