# arirang script example
require 'base64'

class Arirang

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

     def baedal
        ari_title  = "apache auth basic page test \n"
        ari_desc   = "arirang script example\n" 
        ari_author = "pilot <pilot@monkey.org>\n"

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

     def asadal
         ariconnect
         #you can use the dictionary file
         user = "admin"
         pass = "password"
         basic = "#{user}:#{pass}"
         b64 = Base64.b64encode(data)

         buf  = "GET /private/ HTTP/1.0\r\n"
         buf += "Authorization: Basic #{b64}\r\n\r\n"
         response = arisend(buf)
         response.each do |line|
             if line =~ /200 OK*/
                z = "#{$ari_host} - apache auth id:#{user} pass:#{pass}\n"
                ariprint(z)
             end
         end

     end

end

