Hi Guys,
Wondering if someone might be able to assist. I'm not getting any
response back from seomoz using the api. It executes ok, waits for
quite a while, but doesnt return anything. Have I missed something?
<?php
// Initialize the CURL library
$cURL = curl_init();
// Set the URL to execute
curl_setopt($cURL, CURLOPT_URL, "
http://xmlfeed.theeasyapi.com");
// Set options
curl_setopt($cURL, CURLOPT_HEADER, 0);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cURL, CURLOPT_POST, 1);
curl_setopt($cURL, CURLOPT_POSTFIELDS,
"request=<easyapi_wrapper><login><apikey>xxxmyapikeyxxx</apikey></
login><search><service>seomoz</service><method>urlmetrics</
method><criteria><url>
http://www.murdoch.edu.au</url></criteria></
search></easyapi_wrapper>");
// Execute, saving results in a variable
$strPage = curl_exec($cURL);
// Close CURL resource
curl_close($cURL);
// Now the variable $strPage has the returned XML.
$simple_xml = simplexml_load_string($strPage);
if(!empty($simple_xml)){
print_r($simple_XML);
}else{
echo 'The returned data did not come through.';
}
?>
Many thanks
Tim