Sha256: 8fdb7e0eac45a93d4ee2a3dd77667ab5bc48976263c3ca6379d77139be7513a0

Contents?: true

Size: 973 Bytes

Versions: 4

Compression:

Stored size: 973 Bytes

Contents

#!/usr/bin/ruby
#
# This is an example of how to use the RETS client to log in and out of a server. 
#
# You will need to set the necessary variables below.
#
#############################################################################################
# Settings

rets_url = 'http://server.com/my/rets/url'
username = 'username'
password = 'password'

#############################################################################################
$:.unshift 'lib'

require 'rets4r'
require 'logger'

client = RETS4R::Client.new(rets_url)
client.logger = Logger.new(STDOUT)

login_result = client.login(username, password)

if login_result.success?
	puts "We successfully logged into the RETS server!"
	
	# Print the action URL results (if any)
	puts login_result.secondary_response
	
	client.logout
	
	puts "We just logged out of the server."
else
	puts "We were unable to log into the RETS server."
	puts "Please check that you have set the login variables correctly."
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rets4r-0.8.2 examples/client_login.rb
rets4r-0.8.3 examples/client_login.rb
rets4r-0.8.4 examples/client_login.rb
rets4r-0.8.5 examples/client_login.rb