Advanced web ranking AWR cloud script debuged: I have debugged The [get ranking] API call and it works fine on Wamp server 2.4
Observation: DONT’F forget to ALLOW url fopen in you php.ini
open('tempfile.zip');
if ($res === TRUE) {
$zip->extractTo($path_to_extractd_json);
$zip->close();
}
else
{
echo "Could not extract json files from the zip archive";
continue;
}
$dir_handle = opendir($path_to_extractd_json);
// var_dump(readdir($dir_handle));
//Now we can read each extracted json file and output the results
while (false !== ($entry = readdir($dir_handle)))
{
//var_dump($entry);
$entry = $path_to_extractd_json.$entry;
if (!is_file($entry)){
continue;
}
$rankings = json_decode(file_get_contents($entry), true); //Make sure you use associative arrays since the json file contains nested json objects
//var_dump($rankings); exit;
//echo "Search Engine: ".$rankings["searchengine"];
//echo "Search Depth: ".$rankings["depth"];
//echo "Location: ".$rankings["location"];
echo "Keyword: ".$rankings["keyword"];
$rank_data_array = $rankings["rankdata"];
foreach ($rank_data_array as $rank_data)
{
if (stripos($rank_data["url"], "pricerunner")){
echo $rank_data["position"].". ".$rank_data["url"]." result on page ".$rank_data["page"];
echo "
";
}
}
}
}
}
else
{
echo "No results for date=".$the_date;
}
}
?>
More info on AWRCLOUD API can be found on their site. The Update action allow to tag your keywords and is very handy but I haven’ tested the script yet. Good coding!
http://www.advancedwebranking.com/online/developer-api.html