1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to get backlink list with PHP

Discussion in 'PHP' started by folpy, Jan 11, 2015.

  1. #1
    Hi,

    I am looking for a way how to get website backlinks list with PHP. I know the only one way and it is to use google search with "link" query. But there is one problem. If I use google search some website has no backlink but if I use for example Majestic or OpenSiteExplorer these service show me backlink. Can you give me advice how to create backlink list link in Majestic or OpenSiteExplorer?

    Thanks for advice.

    Michal
     
    folpy, Jan 11, 2015 IP
  2. Jigney

    Jigney Active Member

    Messages:
    168
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    93
    #2
    Jigney, Jan 12, 2015 IP
  3. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #3
    wasnt Bing going to take over that full backlink service when Yahoo took a dive ?
     
    ezprint2008, Jan 12, 2015 IP
  4. folpy

    folpy Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #4

    Thanks for advice but there still same problem with using "link" parameter in google search. The problem is the fact that google does not show all backlinks because If I look at majestic seo or opensiteexplorer these services show me more backlinks that google.

    Which service do you mean? I find some information about yahoo backlink service which should take over to bing and I find in bing link explorer but like in google this service show only small number of backlinks.

    Can you have some other ideas?

    Thanks for advice.
     
    folpy, Jan 12, 2015 IP
  5. Richard Clopton

    Richard Clopton Greenhorn

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    I think opensiteexplorer and their API might be more help.
     
    Richard Clopton, Jan 12, 2015 IP
  6. Stepin Solutions

    Stepin Solutions Greenhorn

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #6
    Hope this will be little bit useful to you.. I found it from internet world.

    
    function check_back_link($remote_url, $your_link) {
      $match_pattern = preg_quote(rtrim($your_link, "/"), "/");
      $found = false;
      if($handle = @fopen($remote_url, "r")){
        while(!feof($handle)){
          $part = fread($handle, 1024);
          if(preg_match("/<a(.*)href=[\"']".$match_pattern."(\/?)[\"'](.*)>(.*)<\/a>/", $part)){
            $found = true;
            break;
          }
        }
        fclose($handle);
      }
      return $found;
    }
    
    Code (markup):
    An example of the function in use.

    
    if(check_back_link('http://www.google.com','http://www.yahoo.com')){
      echo 'link found';
    }else{
      echo 'link NOT found';
    };
    
    Code (markup):
    Cheers,
    http://www.stepin-solutions.com//
     
    Stepin Solutions, Feb 8, 2015 IP
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #7
    The last one is completely useless, since you have to know the site you're checking against. This is only useful (somewhat) if you're checking to see if urls you've previously found are still there. It will also only check for one for each page, useless if you want to know how many.
     
    PoPSiCLe, Feb 9, 2015 IP
  8. folpy

    folpy Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #8
    I found out better way. I am using MOZ API which give me backlinks URL,
     
    folpy, Feb 21, 2015 IP