Now that all domains are stored in the $domainarray array, you will need to filter unique domains using array_unique PHP function. All unique domains will then be assigned to a new variable that we call $uniquedomains:
$uniquedomains=array_unique($domainarray);
We will need to display these unique domains in the browser. To do this, we will loop:
while (list($key, $value) = each($uniquedomains)) { echo $value; echo '<br />'; }
Since the Yahoo Site Explorer API can only provide a maximum of 100 results for analysis, we will estimate the real count of unique domain back links. First, we will need to count the number of unique domains obtained from the analysis:
$uniqueinsample = sizeof($uniquedomains);
Then the $count variable holds the actual number of samples provided by the API (maximum 100). $totalbackliksnotunique holds the value for the total back links pointing to the domain (not unique).
$uniquebacklinkstotal= ($uniqueinsample/$count)*($totalbacklinksnotunique);
Therefore the overall remaining PHP script to output the unique back link results back to the browser is as follows:
$uniquedomains=array_unique($domainarray); echo '-----------------------------------------'; echo '<br />'; echo '|THIS IS YOUR LINK POPULARITY STATISTICS:|'; echo '<br />'; echo '-----------------------------------------'; echo '<br />';
$uniqueinsample = sizeof($uniquedomains); $uniquebacklinkstotal= ($uniqueinsample/$count)*($totalbacklinksnotunique);
if ($options==1) { $conditions='ENTIRE SITE'; } if ($options=='') { $conditions='THAT SPECIFIC URL ONLY'; }
echo "<b>ESTIMATED TOTAL BACKLINKS FROM UNIQUE DOMAINS POINTING TO $conditions: ".round($uniquebacklinkstotal).'</b>'; echo '<br /><br />'; echo "These are the unique domains of the total $totalbacklinksnotunique backlinks pointing to $conditions."; echo '<br />'; echo "In a sample gathered, you have $uniqueinsample backlinks from unique domains OUT of $count SAMPLES GATHERED"; echo '<br />'; echo '<a href="/countuniquelinks/countuniquelinks.php"><b>CLICK HERE TO USE THE TOOL AGAIN</b></a>'; echo '<br /><br />'; echo 'Below are the sample unique back linking domains:(100 domains maximum)'; echo '<br /><br />'; while (list($key, $value) = each($uniquedomains)) { echo $value; echo '<br />'; } echo '<br />'; echo '<br />'; echo 'Note: The above domains might belong to the same Class C IP address.'; echo '<br />'; echo '<br />'; echo '<a href="/countuniquelinks/countuniquelinks.php"><b>CLICK HERE TO USE THE TOOL AGAIN</b></a>'; $_SESSION = array (); session_destroy ();
?>
blog comments powered by Disqus |
|
|
|
|
|
|
|