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

Analyzing the Back Link Count from Unique Domains using Yahoo Inbound Links API

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

Formulate a Request to Yahoo Inlinks API

 

It is a wise programming strategy to report all errors, so the first line before communicating to the API is this one:

 

error_reporting(E_ALL);

 

To formulate the request, we need values for the following API variables, which we can obtain from user form input processing discussed in part two:

 

1.) appid = OUiTAC3V35FlhDKeOScqpmw42RTY8B4BI8VUI7kB6sczVWIjJxr45D3QRWcNOPeQ--

 

You should have your own API ID that can be obtained here: http://developer.yahoo.com/search/siteexplorer/

 

2.) query= http://www.thisisyourrootdomainurl.com

 

Query variables are the root domain URL.

 

3.) omit_inlinks=domain

 

This is the default, and cannot be obtained from form processing. Equating it to “domain” means that the API will exclude inlinks data from the same domain as the queried domain. This will ensure that all back links reported come from outside the domain.

 

4.) entire_site=userinputoptions

 

Possible values include 1 to get back link results pointing to the entire site, or “” (empty), to get back link results pointing only to that specific URL.

 

5.) results=100

 

As discussed in the first two parts, the Yahoo API can only provide a maximum of 100 back link URLs. So we say that we want the result variable to return the maximum number (100).

 

6.) output=php

 

This means that the Yahoo API will format the output in a serialized PHP array. You can learn about serialized PHP arrays in greater detail at the link.: 

 

In PHP, the request URL to API in GET statements structure will be formulated as follows (incorporating all six API variables discussed above as a single GET request):

 

$request = 'http://search.yahooapis.com/SiteExplorerService/V1/inlinkData?appid= OUiTAC3V35FlhDKeOScqpmw42RTY8B4BI8VUI7kB6sczVWIjJxr45D3QRWcNOPeQ--&query='.$domainurl.'&results=100&output=php&omit_inlinks= domain&entire_site='.$options;

 



 
 
>>> 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: