Nét Đẹp Việt Nam

 Quên mật khẩu
 Register
Xem: 2671|Trả lời: 0
In Chủ đề trước Tiếp theo

PHP script to check Google backlinks and Google Index

[Lấy địa chỉ]
Nhảy đến trang chỉ định
1#
  As a super webmaster you'll really need to know your website statistic : Google PR, Google backlinks, Google Index. The following php scripts will help you to count google backlink, google index.
  1. <?
  2. function GoogleBL($domain){
  3. $url="http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=link:".$domain."&filter=0";
  4. $ch=curl_init();
  5. curl_setopt($ch, CURLOPT_URL, $url);
  6. curl_setopt($ch, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  9. curl_setopt ($ch, CURLOPT_HEADER, 0);
  10. curl_setopt ($ch, CURLOPT_NOBODY, 0);
  11. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  12. $json = curl_exec($ch);
  13. curl_close($ch);
  14. $data=json_decode($json,true);
  15. if($data['responseStatus']==200)
  16. return $data['responseData']['cursor']['resultCount'];
  17. else
  18. return false;
  19. }
  20. ?>
Sao chép mã
Save as: GoogleBLclass.php to count google backlink

  1. <?
  2. function GoogleIP($domain){
  3. $url="http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:".$domain."&filter=0";
  4. $ch=curl_init();
  5. curl_setopt($ch, CURLOPT_URL, $url);
  6. curl_setopt($ch, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  9. curl_setopt ($ch, CURLOPT_HEADER, 0);
  10. curl_setopt ($ch, CURLOPT_NOBODY, 0);
  11. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  12. $json = curl_exec($ch);
  13. curl_close($ch);
  14. $data=json_decode($json,true);
  15. if($data['responseStatus']==200)
  16. return $data['responseData']['cursor']['resultCount'];
  17. else
  18. return false;
  19. }
  20. ?>
Sao chép mã
Save as GoogleIPclass.php to count google index page.

Now this is your own website tool to count your website Google back links and indexed page.

  1. <?
  2. require("GoogleBLclass.php");
  3. require("GoogleIPclass.php");
  4. $domain="netdepviet.org"; //your domain name
  5. echo GoogleBL($domain); //get backlinks
  6. echo GoogleIP($domain); //get indexed page
  7. ?>
Sao chép mã
All done . Have fun
Bạn phải đăng nhập mới được đăng bài Đăng nhập | Register

Quy tắc điểm

Phòng tối|iPhone|Archiver|G+|Youtube|Facebook|Twitter|Contact| Netdepviet.org

GMT+7, 19-4-2024 10:33 PM , Processed in 0.027729 second(s), 20 queries .

Powered by Discuz! X3.2

© 2006 Made with in Hanoi,Vietnam and Contents are published by all members

Trả lời nhanh Lên trên Trở lại danh sách