# robots.txt check examples
# by pilot

class Arirang

@ari_recvsize = 200000
@ari_recvflag = 3
#@ari_port = 80

     def baedal
        ari_title   = "html link check\n"
        ari_desc    = "arirang ruby script examples\n"
        ari_author  = "pilot <pilot@monkey.org>\n"

        puts "title: #{ari_title}"
        puts "desc: #{ari_desc}"
        puts "author: #{ari_author}"

     end

     def asadal
         ariconnect
         buf  = "GET / HTTP/1.1\r\n"
         buf += "Host: #{$ari_host}\r\n\r\n"
         res = arisend(buf)
         ariclose
         link = res.scan(/<a[^>]+?href\s*=\s*["']?([^'" >]+?)[ '"]?>/mi) 
         puts $ari_host  + " - html links"
         puts link
     end

end

