1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to get the number of backlinks and indexed pages?

Discussion in 'Black Hat SEO' started by fandi, Oct 16, 2011.

  1. fandi

    fandi Registered Member

    Joined:
    Sep 18, 2011
    Messages:
    68
    Likes Received:
    2
    When using simple (e.g. php) script to catch the number of indexed pages and backlinks for a domain; search engines may ban the server IP to capture these information. For example, bing has clearly stated in ToS of API that must NOT use for getting the number of results.

    Bu there are lots of chrome and firefox extensions, capturing these data for every page I visit (even I do not want these data). How they work?

    Where is the best source to capture these data? I want to write a simple php script to catch the number pages indexed by Google, Bing, Yahoo, and backlinks.

    NOTE: There are advanced scripts with mysql support for this purpose (to avoid regular connection to search engines), but I want a simple real-time script.
     
  2. oinari

    oinari Newbie

    Joined:
    Aug 7, 2011
    Messages:
    1
    Likes Received:
    1
    those extensions are clientside - essentially they use your IP to get the result page and then parse it internally to get the number. this makes it possible for the authors to avoid getting bans etc.

    if you want to do your own serverside PHP retrieval of such info (especially in bulk), you need proxies since you're going to get banned (by Google at least - Yahoo and Bing are much more relaxed here).

    but technically it's super simple - just do


    $out = read_through_proxy("some-google-query-with-some-params");

    if (preg_match_all("/(\d+,)*\d+ result/", $out, $matches) > 0)
    {
    $res = $matches[0];
    $results = $res[0];
    $results = str_replace("About", "", $results);
    $results = str_replace("result", "", $results);
    $results = str_replace(",", "", $results);
    $results = trim($results);
    }

    - that will give you the number of results for a G search - or


    if (preg_match_all("/Inlinks \(\d{1,10}+(,?\d{1,10}+)?\)/", $out, $matches))
    {
    $res = $matches[0];
    $results = $res[0];
    $results = str_replace("Inlinks (", "", $results);
    $results = str_replace(")", "", $results);
    $results = str_replace(",", "", $results);
    $results = trim($results);
    }

    - that will give you the Yahoo IBLs.

    the above code is of course nowhere elegant or optimized - just some stuff that i wrote along the way.

    Best,
    Mike
     
    • Thanks Thanks x 1
  3. fandi

    fandi Registered Member

    Joined:
    Sep 18, 2011
    Messages:
    68
    Likes Received:
    2
    Thanks Mike
    Exactly, the answer I needed :)