Esempio n. 1
0
    // dont run Saturday or Sunday
    die;
}
$sql = 'select * from tb_municipality where name="' . $city . '"';
$res = mysql_query($sql);
$cityrow = mysql_fetch_array($res, MYSQL_ASSOC);
$cid = $cityrow['id'];
$sql = 'update tb_municipality set feed_dated=now() where id=' . $cid;
$res = mysql_query($sql);
$dsid = $cityrow['default_subdivision'];
$fields_needed = array('zz', 'housenum', 'propcode', 'bedrooms_up', 'bedrooms_down', 'fullbaths', 'halfbaths', 'sqftg', 'age', 'publicoverview', 'lprice', 'taxes', 'taxyr', 'la1_a_userid', 'la2_a_userid', 'mlsnumber', 'lotsize_acres', 'garage', 'daysonmarket', 'matrix_unique_id', 'photocount', 'sdistrict', 'city', 'street', 'strtyp', 'status', 'major_area', 'dl1_range', 'dl1_section', 'dl1_township', 'dl1_westofmeridian', 'dl1_location');
$data_field = array('zz', 'building_no', 'postalcode', 'beds_up', 'beds_down', 'full_baths', 'half_baths', 'square_footage', 'building_age', 'public_overview', 'listing_price', 'tax_amount', 'tax_year', 'realtor1id', 'realtor2id', 'listing_no', 'acres', 'garage_typeid', 'days_on_market', '', '', '', '', '', '', '', '', '', '', '', '', '');
$found = array();
$rets = new RETS();
//Login to NAR CRT Test Server
$results = $rets->login($Host = 'http://matrix.gpreb.com/rets/login.ashx', $Account = 'Division1', $Password = '******', $User_Agent = 'RETS_class/1.0', $User_Agent_Pwd = null, $User_Agent_Auth = false, $Rets_Version = 'RETS/1.5', $Standard_Names = false, $Post_Requests = true, $Format = 'COMPACT-DECODED', $HTTP_Logging = true);
if (!$results) {
    exit;
}
$clss = array('RESI', 'FARM', 'MULTI', 'COMM');
for ($mm = 0; $mm <= 3; $mm++) {
    echo $clss[$mm] . '<br>';
    $response = $rets->Search($Resource = 'Property', $Class = $clss[$mm], $Count = 1, $Format, $Limit = 2500, $QueryType = 'DMQL2', $Standard_Names, $Select = '*', $Query = '((City=*))');
    usleep(50000);
    $doc = new DOMDocument();
    $doc->loadXML($response);
    echo $doc->getElementsByTagName("COLUMNS")->item(0)->nodeValue;
    $col = strtolower($doc->getElementsByTagName("COLUMNS")->item(0)->nodeValue);
    $columns = explode("\t", $col);
    echo $response;
    $mlsno = -1;
Esempio n. 2
0
require_once 'rets-config.php';
require_once 'rets.php';
require_once 'wp-manager.php';
// Init a rets class
$rets = new RETS();
// Init a wordpress manager class
$wp = new WPManager();
// Set params required to run on our server
$rets->__set('host', RETS_HOST);
// Specify full path to cookie file.
$rets->__set('username', RETS_USERNAME);
// Specify full path to cookie file.
$rets->__set('password', RETS_PASSWORD);
// Specify full path to cookie file.
$rets->__set('Login', RETS_LOGIN);
// Specify full path to cookie file.
$rets->__set('cookie_file', COOKIE_FILE);
// Specify full path to cookie file.
$rets->__set('disable_follow_location', DISABLE_FOLLOW_LOCATION);
// Disable follow location as open_basedir restirction is in effect.
$rets->__set('debug_file', DEBUG_FILE);
// Set debug file path.
$rets->__set('debug', DEBUG);
// Enable debug mode
$rets->__set("compression_enabled", COMPRESSION_ENABLED);
// Set supported options for FlexMLS
$rets->__set("offset_support", OFFSET_SUPPORT);
// Set supported options for FlexMLS
// Connect to RETS server
$login = $rets->login();