This is trickier to do. However, the strategy is simple. Yahoo Links API provides a title tag of the inbound link pages. Since a title tag basically tells us what the page is all about, you can analyze the keywords contained in the title tag and then return statistics to the user to provide information on whether the inbound links to the website are related. The code to be added to original script is as follows: //Extract the title tag from the Yahoo Links API array $mytitletag = $display1[$x]['Title']; //You also need to assign the title tag to an array. $titlearray[] = $mytitletag; //Now since there are inbound link pages that comes from the same //domain, hence also contains the same title tag, you need to filter $uniquetitletags = array_unique($titlearray); //Start of link relevance analysis //Reset array reset($uniquedomains); echo '<br />'; echo '|THIS IS THE LINK RELEVANCE REPORT FOR '.$domainurl; echo '<br />'; echo '---------------------------------------------------'; echo '<br />'; //A short explanation about the link relevance analysis strategy echo 'The relevance of your backlinks are computed based on the title tag of your backlinking pages. These title tag are important because it tells us what the backlink page is all about. The keywords from the title tag are then extracted and analyzed.'; echo '<br />'; echo 'If these keyword lists that is sorted by percentages MATCHES with your domain or website topic or niche, then congratulations; your backlinks are relevant to your website.<br />'; echo '<br />';
//Parts of the code is taken from http://bit.ly/5egil, authored by Tom
$numWords = count($words);
arsort($word_count);
include '/opt/lampp/htdocs/backlinkcount/stopwordslist.php'; //now that the stopwords array is in placed $stopwordarray= array();
foreach ($word_count as $key=>$val) {
//Also check if the word consist entirely of English alphabets, this //Exluded also in the analysis are words that consist of less than 3 if ((in_array($key,$stopwords)) || (!(ctype_alpha($key))) || (strlen($key) < 3 )) { $stopwordarray[] = $key; } }
$stopwordcount = sizeof($stopwordarray);
$adjustednumWords = $numWords - $stopwordcount;
foreach ($word_count as $key=>$val) { if ((!(in_array($key,$stopwords))) && (ctype_alpha($key)) && (strlen($key) > 2)) {
//as well as the percent occurrences echo "<b>$key = $val</b>. Percent occurrence: ".number_format(($val/$adjustednumWords)*100)."%<br/>n"; } }
blog comments powered by Disqus |
|
|
|
|
|
|
|