Returns various chars in the body string. Not sure what is going but simplexml_load_string fails due to the chars in the string. If I remove the fsockopen and use php's file_get_contents all is fine and works wonderfully. Below you can see what I did to get it work on my end if you like I can make a pull request with the code change?
verticaltab/pillow/src/VerticalTab/Pillow/HttpClient.php : line 27
/**
Gets the url (relative to host)
@param string $url
@return \SimpleXMLElement
*/
public function get($url) {
$body = '';
/*
$fp = @fsockopen($this->host, 80, $errno, $errstr);
if(!$fp) {
$msg = "Failed to open connection {$this->host} $errno $errstr";
throw new Exception($msg);
}
When using the API to get data for these properties and various others:
Address, Zip 19385 Cypress Ridge Terrace, 20176 10 Glen Ave, 02896
Returns various chars in the body string. Not sure what is going but simplexml_load_string fails due to the chars in the string. If I remove the fsockopen and use php's file_get_contents all is fine and works wonderfully. Below you can see what I did to get it work on my end if you like I can make a pull request with the code change?
verticaltab/pillow/src/VerticalTab/Pillow/HttpClient.php : line 27 /**
/* $fp = @fsockopen($this->host, 80, $errno, $errstr); if(!$fp) { $msg = "Failed to open connection {$this->host} $errno $errstr"; throw new Exception($msg); }
*/ $body = file_get_contents('http://'.$this->host.$url); echo $body.PHP_EOL; $xml = @simplexml_load_string($body); if(!$xml) { throw new Exception('Unable to load xml result'); }
}