【I am looking for a job】我在找工作,欢迎推荐 -- 此博客已废弃,不再更新!本人暂时或永远不再从事该领域研究,相关问题请勿联系!
查看文章 |
Linux下的抓书工具2
2007-07-03 13:59
原帖在:http://hi.baidu.com/vvfang/blog/item/d9169010d5e9d600213f2eb6.html 由于baidu空间对文章字数进行了限制,因此在此贴中继续更新. [网站已失效] 我喜欢的鬼故事网站(长篇频道) #!/bin/bash rm $2.txt echo echo "START" wget -r -l 1 -A "*.htm" -p -q -nd $1 cat *.htm | grep "<\/P><P>" >> $2.txt rm *.htm sed -i 's/<P>//g' $2.txt sed -i 's/<\/P>/\ /g' $2.txt sed -i 's/<BR>/\ /g' $2.txt sed -i 's/\ //g' $2.txt sed -i 's/<[^<]*>//g' $2.txt echo "END" 保存为hcdjtest 要下载的是http://gui.hcdj.com/longgui/list_136.htm上介绍的书 使用方法是(注意这里不需要设置章节数) ./hcdjtest http://gui.hcdj.com/longgui/list_136.htm 17ns 最后书会保存为17ns.txt 中科大瀚海星云BBSMarvel版精华区 #!/bin/bash rm $2.txt echo echo "START" wget -r -l 1 -A "bbsanc*" -p -q -nd $1 cat *.A >> $2.txt rm *.A sed -i 's/\ //g' $2.txt sed -i 's/<[^<]*>//g' $2.txt sed -i '/^$/d' $2.txt echo "END" 保存为ustctest 注意该shell程序只能下载多章节(中,长篇)故事,主要位于原创文集中和转载精华中,下载前请确认该文是否是多章节故事,如转载精华中的传统作家->周德东->三岔口 http://bbs.ustc.edu.cn/cgi/bbs0an?path=/groups/GROUP_7/Marvel/D509124F1/DB27B5E39/DAE8A2202/DB53DFE54 使用方法是(注意这里不需要设置章节数) ./ustctest http://bbs.ustc.edu.cn/cgi/bbs0an?path=/groups/GROUP_7/Marvel/D509124F1/DB27B5E39/DAE8A2202/DB53DFE54 sanchakou 最后书会保存为sanchakou.txt [网站已失效] 溜溜读书频道 #!/bin/bash rm $2.txt echo echo "START" wget -r -l 1 -A "read.asp*" -p -q -nd $1 cat read.asp* >> $2.txt rm read.asp* cat $2.txt | grep "<br />" >> $2 mv $2 $2.txt sed -i 's/<[^<]*>//g' $2.txt sed -i '/\ /d' $2.txt sed -i '/Copyright/d' $2.txt sed -i '/document/d' $2.txt echo "END" 保存为66booktest 使用方法是(注意这里不需要设置章节数) ./66booktest http://www.66book.net/contents.asp?bookid=3693 zgf 最后书会保存为zgf.txt 之乎书坊 [注意这个网站的书使用UTF-8编码的而非GB2312] #!/bin/bash rm $2.txt echo echo "START" wget -r -l 1 -A "section_content.php*" -p -nd -q $1 rm robots.txt cat section_content.php* >> $2.txt rm section_content.php* sed -i 's/<\/div>/<br \/>/g' $2.txt cat $2.txt | grep "<br />" >> $2 mv $2 $2.txt sed -i '/class/d' $2.txt sed -i 's/<[^<]*>//g' $2.txt echo "END" 保存为wannishtest 使用方法是(注意这里不需要设置章节数) ./wannishtest http://www.wannish.com/section_list.php?id=3199 fuwa 最后书会保存为fuwa.txt --------------------------------------------- 相关代码可以在Sourceforge上下载,地址是:http://sourceforge.net/projects/zhuashushell 声明:不要用这个东东干坏事,印刷盗版书籍哦:) |