亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

ruby寫掃描當(dāng)前網(wǎng)頁(yè)所有url的腳本

 更新時(shí)間:2008年06月25日 21:00:36   作者:  
用ruby寫的掃描當(dāng)前網(wǎng)頁(yè)所有url的腳本,對(duì)于學(xué)習(xí)ruby的朋友是個(gè)不錯(cuò)的實(shí)例
#scanweb.rb

#用法ruby scanweb.rb chabaoo.cn 將當(dāng)前結(jié)果保存在c:\1.txt

require 'net/http'
filename= File.new('c:\1.txt',"w+")
if $*[0]==nil 
puts "hehe,沒有輸入網(wǎng)址"
else
h = Net::HTTP.new($*[0], 80)
resp, data = h.get('/index.html', nil)
if resp.message == "OK"
data.scan(/<a href="(.*?)"/).each do |x|
puts x
filename.puts x
end
end
end

#無聊,有vbs、php、ruby版了,好像ruby比vbs快,與php不相上下。

=begin

修改一下

require 'net/http'
filename= File.new('1.txt',"w+")
if $*[0]==nil 
abort "用法示例:ruby #$0 www.sohu.com ,結(jié)果放在當(dāng)前目錄1.txt" 
end

h = Net::HTTP.new($*[0], 80)

resp, data = h.get('/index.html', nil)
if resp.message == "OK"
data.scan(/<a href="(.*?)"/).each do |x|
puts x
filename.puts x
end
end

=end

相關(guān)文章

最新評(píng)論