module Xml

class Report < ActiveResource::Base
#      self.site = "http://request.rinet.ru/login-xml.php"
       self.site = "http://request.rinet.ru/"
       # Xml::Report.find(:all, :from=> '/login-xml.php', :attributes=>"name='zag3k2'") Xml::Report.find(:all, :from=> '/login-xml.php')      
      
     def self.mon()
      #require 'net/http'
      #require 'rubygems'
      #require 'xmlsimple'
      
      #url = 'http://request.rinet.ru/login-xml.php'
      xml_data = Net::HTTP.get_response(URI.parse('http://request.rinet.ru/login-xml.php')).body
      
      data = XmlSimple.xml_in(xml_data)
      
      data['logins'].each do |item|
         #item.each do |k, v|
            print "#{v[0]}"
            #if ["name"].include? k
            #   print "#{v[0]}" if k=="name"
            #  print " => #{v[0]}\n" if k=="Url"
           #end
        #end
      end
      
     end 
      
end



end