刷百度下拉关键词

原创
2016-07-25 09:06:281666浏览
刷百度下拉关键词 http://www.tongqiong.com/read.php?tid-91-ds-1.html
  1. //作者:www.tongqiong.com
  2. $url1="http://www.baidu.com/s?bs=www.naligouwu.com&f=8&rsv_bp=1&wd=%CD%F8%C9%CF%B9%BA%CE%EF%CD%F8%D5%BE%B4%F3%C8%AB&inputT=".rand(500,3000)."";
  3. $url2="http://www.baidu.com/s?bs=%C4%C4%C0%EF%B9%BA%CE%EF&f=8&rsv_bp=1&wd=%B9%BA%CE%EF&inputT=".rand(500,3000)."";
  4. $url3="http://www.baidu.com/s?bs=www.naligouwu.com&f=8&rsv_bp=1&wd=naligouwu&inputT=".rand(500,3000)."";
  5. $url4="http://www.baidu.com/s?bs=%C4%C4%C0%EF%B9%BA%CE%EF&f=8&rsv_bp=1&wd=naligouwu&inputT=".rand(500,3000)."";
  6. function parseUrl($url)
  7. {
  8. $parse_url = parse_url($url);
  9. return (!empty($parse_url['scheme']) && !empty($parse_url['host']));
  10. }
  11. //获取url的内容
  12. function getUrlContent($url)
  13. {
  14. $content = '';
  15. if(!parseUrl($url))
  16. {
  17. $content = @file_get_contents($url);
  18. }
  19. else
  20. {
  21. if(function_exists('curl_init'))
  22. {
  23. $ch = curl_init();
  24. curl_setopt($ch, CURLOPT_URL,$url);
  25. curl_setopt($ch, CURLOPT_TIMEOUT, 5);
  26. curl_setopt($ch, CURLOPT_USERAGENT, _USERAGENT_);
  27. curl_setopt($ch, CURLOPT_REFERER,_REFERER_);
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  29. $content = curl_exec($ch);
  30. curl_close($ch);
  31. }
  32. else
  33. {
  34. $content = @file_get_contents($url);
  35. }
  36. }
  37. return $content;
  38. }
  39. getUrlContent($url1);
  40. getUrlContent($url2);
  41. getUrlContent($url3);
  42. getUrlContent($url4);
  43. echo "成功";
  44. //作者:www.tongqiong.com
  45. ?>
复制代码


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
上一条:操作MySQL数据库的php类 下一条:Stronger、PHP框架(自己开发的应用框架)

相关文章

查看更多