Through the previous 4 parts of this tutorial we’ve created everything we need to download our MLS feed with RETS. Now we need to make one small change to our batch file, and execute it. We need to use an Advanced Query to retrieve only Active listings from our RETS provider. You may want to first read over the Batch File documentation. Remember in creating the Source I mentioned choosing Status as a searchable field?
Creating an Advanced Query For Active Listings
First we need to go into our /vieleRETS/batch_control_files directory with a file browser or ftp manager. Open to edit the file with the name of your Extract. According to this forum post we need to query L_Status=1_0,1_1 so the final product should resemble this:

Save this file back to your server where it belongs. Now we’re ready to download our listings!(I know I know, its been long enough already…)
Executing the Batch File
If you’re on a remote server you will need to ssh into your server and into the vieleRETS directory. If you’re on a local machine just navigate via command prompt to that directory. If you read the documentation linked to above you know there are a few options while executing. But here goes nothing. I’ll use “My_Extract” as the name of your Extract, you should replace this with whatever you called yours. From the command line enter the command :
php -f ./run_interactive_job.php batch_control_files/My_Extract
With a little luck and a lot of time you are now downloading your listings. The only thing left is to schedule your download. I’ll leave this up to you as every hosting environment is different. Remember however when you set up your scheduled executer you will need to state the full directory path instead…
php -f /somedir/vieleRETS/run_interactive_job.php batch_control_files/My_Extract
Now go get a cup of coffee and relax after this stressful ordeal! You deserve it!
- RETS Retrieval with PHP and VieleRETS: Part 1, Introduction
- RETS Retrieval with PHP and VieleRETS: Part 2, Creating a Source
- RETS Retrieval with PHP and VieleRETS: Part 3, Creating a Target
- RETS Retrieval with PHP and VieleRETS: Part 4, Creating an Extract
- RETS Retrieval with PHP and VieleRETS: Part 5, Executing the Batch
- RETS Retrieval with PHP and VieleRETS: Part 6, Creating a Cron Job
Related posts:


13 Responses
david
20|Apr|2008seems that your part 4 has a misplaced link to part 5. url is looking for p=58 and part 5 is p=59
trent
21|Apr|2008Thanks David, should be fixed now!
Chris
05|Oct|2008Can you update your documentation as it doesn’t look like your sample posted above.
The syntax is very different.
Thank You
trent
06|Oct|2008I haven’t used the latest version so it is possible there is a different syntax, do you have any examples? In the mean time I will download the new one myself.
Chris
12|Oct|2008I got this to work:
=A,B
Chris
12|Oct|2008=A,B
Chris
12|Oct|2008For some reason the website is stripping the code: Take out the extra spaces around the tags
=A,B
trent
12|Oct|2008Excellent, glad you got it working, and THANKS for posting your solution!
Quinn
14|Jan|2009Thank you SO MUCH for writing this. My company has recently been contracted to re-design a MLS company website and I’ve been struggling with this whole RETS business. This tutorial has been absolutely invaluable!
Eliot Jones
19|Dec|2009Thanks for this Trent!
It appears that others have mentioned that the Admin Interface has changed since you wrote your tut.
I’ve created a Target, Source, and Extract although I don’t see anything in the “batch_control_files” directory???
Have any thoughts on why this occurred? I was under the impression that upon creating an extract that this happened automatically?
Thanks again!
eliot
trent
21|Dec|2009Hey Eliot,
From what I understand the new vielerets has changed a good bit and these posts here may be out of date. I have not touched viele in over a year unfortunately. The best bet is their mailing list: http://mail.crt.realtors.org/mailman/listinfo/viele-dev
Eliot Jones
24|Dec|2009Thanks for the follow up Trent.
I was able to run php -f run_interactive_job.php
from the command line to create the batch file.
Now i’m working to get all the data into mySQL. I’ve been able to download everything including images but only as XML and CSV.
Ideally I’d like to have this all stored in database and automated to get new data daily.
Eliot
sendil
16|Nov|2010Please response me trent. how to install open houses in vielerets