1. Home >
  2. Backlinks >
  3. How to develop a backlink verifier tool

How to develop a backlink verifier tool

21 Oct, 2016

Backlink verifier tool is used to check backlinks of your website on other websites. If you want to check your site’s link from 100 websites then it is difficult to check all those webpages one by one. And also you don’t know where the location of that link is and what is the anchor text of that link is.

Before we start developing this tool I want to tell you how our verify backlins tool works in the backend.

  1. First of all this tool separate urls list with “\n”
  2. Then this tool fetch data of each url and get the data side body tag of urls
  3. After that it fetches all urls in that website and anchor texts.
  4. And at the end it  it compares your url with the links that used in that specific webpage

Let’s Start

Explode urls list with \n.

We use jquery to separate urls with \n, but you can also use any other language that you want.

Separating using php:

 

$UrltoMatch = 'http://www.softo.org';
$listUrls = explode("\n", $_POST['urls_list']);

 

After separation run a loop and fetch data of every webpage using php curl.

 

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSLVERSION,3); 
$result = curl_exec($ch);
curl_close($ch);

 

Now we have to get all links and anchor text used in that webpage so that we can compare it with the url that we want to verify. I am using simple_html_dom (a php library) to fetch all those anchor href attributes and anchor texts. And match your website with all those links that we got using html dom.

include('simple_html_dom.php');
$html = str_get_html($result);
$body = $html->find("body", 0);
$aTags = $body->find("a");
foreach($aTags as $singleTag)
{
    if($singleTag->href == $UrltoMatch)
    {
        echo "Your website Link Found having anchor text ".$singleTag->innertext;
    }
}

All done! Hope you liked this tutorial. I am not a professional writer that’s why you might have some difficulties to understand my wording. Please share this tutorial to keep me excited about my work.

Share it to appreciate us


Share on facebook Share on google+ Share on twitter