Hi-
I'm not sure of the capabilities of various RETS servers, but on the
two projects I've worked on my flow was something like:
* Grab all the listings
* Iterate over the list, grabbing all the photos -- throttling and
re-trying the request if necessary.
* When a listing changes, delete all photos and grab all the photos
for that listing again.
I didn't see a way to determine new/modified photos and when I asked the
administrator of the RETS server I worked with told me that the above was
their preferred method for acquiring photos.
Here is a snippet of my quick-n-dirty code which ended up being just clean
enough to keep using :)
$rs = $dbh->execute($sql); #returns the mlsID and RETS key for modified listings
while (!$rs->EOF ) {
$mlsID=$rs->fields['mlsID'];
$retsID=$rs->fields['retsID'];
$digit = substr($mlsID,-1,1);
$outputDir = "$dataDir/images";
RDEBUG("Property: $mlsID $retsID $digit",1);
$photos = $rets->GetObject("Property", "Photo", $retsID);
foreach ($photos as $photo) {
$listing = $photo['Content-ID'];
$number = $photo['Object-ID'];
if ($photo['Success'] == true) {
file_put_contents("$outputDir/{$mlsID}_{$number}.jpg",
$photo['Data']);
} else {
RDEBUG(sprintf("$listing - $number: %s =
%s",$photo['ReplyCode'], $photo['ReplyText']),1);
}
}
$rs->movenext();
}
-t
> --
> You received this message because you are subscribed to the Google Groups "PHRETS" group.
> To post to this group, send email to phr...@googlegroups.com.
> To unsubscribe from this group, send email to phrets+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/phrets?hl=en.
>
>
$rets = new phRETS;
...
$values = $rets->GetLookupValues($Resource, $Field);
You can find details in phRETS docs.