Skip to content

jkestr/rechanize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rechanize is a simple RETS client.
Rechanize provides an interface for querying metadata, data and objects.

== Initialize The Client
login  = "http://user:pass@rets.com/login_path"
client = Rechanize::Client.new(login)

== Build A Search
params = 'SearchType=Property&Class=Residential'
format = '&Query=(LN=*),(RECODMODDATE=%s%s)'
query  = params + (format % [Date.today, '%2B'])

== Get Some Datas
client.get(query) do |listing|
  puts "$#{listing['LP']  ##{listing['LN']}"
  puts "#{listing['STRNUM']} #{listing['STR']}"
  puts "#{listing['CITY']} #{listing['ST']}"
end

== Build An Image Request
params = 'Resource=Property&Type=Photo&Id=%s:%s'
query  = params % ["0", "*"]

== Get Some Images
client.get(query) do |index, headers, data|
  puts "Image #{index} is a #{headers['content-type']}"
end


TODO Finish testing
TODO Class methods on Rechanize for parsing dates to and from RETS datetime strings
TODO Test with a service other then MRED
TODO Incorporate the visitor pattern to handle different protocol versions.

About

Rechanize is a simple RETS client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages