Escolar Documentos
Profissional Documentos
Cultura Documentos
/usr/bin/ruby
include Librets
# Empty value for "values". I can into a problem with line 55 which required me to
put this in.
values = ""
mls_number = ""
# Optional: I was going off another Ruby::DBI set of instructions. Only include if
you want to start from fresh each time.
mysql.query("ALTER TABLE residentialpropertyphotos DROP FOREIGN KEY
residentialpropertyphotos_ibfk_1;")
mysql.query("DROP TABLE IF EXISTS ResidentialProperty")
mysql.query("DROP TABLE IF EXISTS ResidentialPropertyPhotos")
#Creates the Database to work with. I pulled the metadata from the RETS feed to
determine what the field types and lengths are
mysql.query("CREATE TABLE ResidentialProperty (L_ListingID INT UNSIGNED NOT NULL,
PRIMARY KEY (L_ListingID),
L_AskingPrice INT NOT NULL, L_Keyword2 INT NOT NULL, L_Keyword3 INT
NOT NULL, L_Keyword4 INT, L_City CHAR(50) NOT NULL, L_Area varchar(50) NOT NULL,
L_AddressNumber varchar(15) NOT NULL, L_AddressDirection varchar(2),
L_AddressStreet varchar(50) NOT NULL, LR_Remarks11 varchar(1000),
LA1_UserFirstName varchar(15) NOT NULL, LO1_OrganizationName
varchar(50) NOT NULL, LO1_PhoneNumber1Area INT,
LO1_PhoneNumber1 INT) Type=INNODB;")
# Your DMQL syntax for your search. This search is grabbing all Active Residential
listings.
request = session.create_search_request("Property", "ResidentialProperty",
"(L_Status=1_0)")
mls_number = row[0]
get_object_response = session.get_object(get_object_request)
end