# arirang ruby script example
class Arirang

#@ari_port = 80
#@ari_recvsize = 1024
#@ari_recvflag = 3
    
    def baedal
        $ari_info = {
        'description' => '-G option to arirang ruby script',
        'author' => 'pilot pilot@monkey.org'
        }
        puts $ari_info['description'] + "\n\n" 
    end

    def asadal
        ariconnect
        extra = "GET / HTTP/1.0\r\n\r\n"
        response = arisend(extra)
        response.each 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

