Home arrow PHP arrow Page 3 - Analyzing the Back Link Count from Unique Domains using Yahoo Inbound Links API

Filter unique domains and display in browser - PHP

Welcome to the conclusion of a three-part series that shows you how to count the back links to your web site from unique domains using the Yahoo Inbound Links API. In the second part you learned how to pass the form variables to PHP using AJAX, process the web form input using PHP, and finally validate the root domain name URL using PHP. In this part, we discuss the details of the Yahoo API PHP script process.

TABLE OF CONTENTS:
  1. Analyzing the Back Link Count from Unique Domains using Yahoo Inbound Links API
  2. Get API results and do preliminary data processing
  3. Filter unique domains and display in browser
  4. Running and performing a test implementation
By: Codex-M
Rating: starstarstarstarstar / 2
January 26, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

 

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:&nbsp;".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 ();

 

?>

 



 
 
>>> More PHP Articles          >>> More By Codex-M
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: