# arirang ruby script example
class Arirang

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

     def baedal
        $ari_info = {
        'description' => '-G option + HTTP/1.1 to arirang ruby script',
        'author' => 'pilot pilot@monkey.org'
        }
        puts $ari_info['description'] + "\n\n" 
     end

     def asadal
         ariconnect
         buf  = "GET / HTTP/1.1\r\n"
         buf += "Host: #{$ari_host}\r\n\r\n"
         response = arisend(buf)
         response.each_line do |line|
         x = line.match(/^Server\: (.+)\r/)
            if x != nil
                y = "#{$ari_host} - #{$ari_sport}/tcp - #{x[1]}\n"
                ariprint(y)
            end
         end
     end

end


