キャッシュ機能追加 #!/usr/bin/ruby -KU -w require 'net/http' require 'kconv' def getfile(url) content='' begin res = Net::HTTP.get_response(URI.parse(url)) puts "#{res.code} #{url}" if res.code == '200' content=res.body.toutf8 end rescue Timeout::Error rescue SocketError end content end def scanhref(url,re) getfile(url).scan(re) end Dir.mkdir('./ima') if ! FileTest.directory?('./ima') Dir.mkdir('./kako') i