网站快速收录工具,网站快速获取搜索流量的方法

搏一搏,单车变摩托,怎么样,网站才能快速获权,怎么样,网站才能快速获取流量,怎么样......就是快速提升网站权重和流量。下面,小千就写一个代码,这个代码只需一个文件,你可以认为是泛程序、泛目录、泛工具等等,总之,就是快速获取收录、快速获取关键词、快速获取网站流量等等。

教程开始

新建一个 ao.php 文件,代码如下

PHP
  1. <?php 
  2. error_reporting(0);
  3. header('Content-type:text/html;charset=utf-8');
  4. ob_start('ob_gzhandler');
  5. date_default_timezone_set('Asia/Shanghai');
  6.  
  7. $ititlesearc = $_GET['so'] == '' ? '' : '<title>'.$_GET['so'].'</title>';
  8. //只给指定蜘蛛抓取
  9. $userAgent = $_SERVER['HTTP_USER_AGENT'];//获取User Agent信息
  10. $searchEngines = array('Baiduspider','bingbot','Sogou','Bytespider','YisouSpider');//指定蜘蛛访问
  11. $isSearchEngineBot = false;
  12. foreach ($searchEngines as $searchEngine) {
  13.     if (stripos($userAgent, $searchEngine) !== false) {
  14.         $isSearchEngineBot = true;
  15.         break;
  16.     }
  17. }
  18. if ($isSearchEngineBot == false) {
  19. echo $ititlesearc.'<p style="display:flex;align-items:center;justify-content:center;height:98%;cursor:pointer;">本地法律要求通知,部分结果未予显示。&emsp;<a href="/">返回首页</a></p>';
  20. exit();
  21. }
  22. //只给指定蜘蛛抓取
  23.  
  24. //先设置一个缓存文件 来保存当天缓存日期
  25. $cachefile = 'ao_sosuo_cache.txt';
  26. // 检查缓存文件是否存在
  27. if (!file_exists($cachefile)) {
  28.     //不存在就创建缓存文件
  29.     fopen($cachefile, 'w');
  30. }
  31. // 缓存文件 保存一天 获取当前日期
  32. $cachedate = date('H');
  33. // 读取缓存文件的日期
  34. $cacheddate = file_get_contents($cachefile);
  35. // 检查缓存是否过期
  36. if ($cacheddate != $cachedate) {
  37. //缓存未过期,直接读取缓存文件并输出
  38. require_once('ao_sosuo_inc.php');
  39. $surlaa = 'https://top.baidu.com/board?tab=realtime';
  40. $lines_array = file($surlaa);
  41. $lines_string = implode('', $lines_array);
  42. eregi("(.*)",$lines_string, $ahead);
  43. $rurl = $ahead[0];
  44. if ($ahead[0] == ''){$rurl = fget($surlaa,5);}
  45. $szzaa = '#,"query":"(.*?)",#';
  46. preg_match_all($szzaa,$rurl,$aaaaa);
  47. $one = $aaaaa[1];//标题
  48. //echo $rurl;
  49. $i=0;
  50. foreach ($one as $ni=>$cs) {
  51. if ($i<100) {
  52. $y = $i+1;//序号
  53. $soss .= $cs."\n";
  54. $i ++;
  55. }
  56. }
  57. $three = trim($soss);
  58. if (!empty($three)){
  59.     $contentFile = fopen(dirname(__FILE__).'/ao_sosuo_txt.txt', 'w');
  60.     fwrite($contentFile, $three);//写入数据内容
  61.     fclose($contentFile);
  62. }
  63. file_put_contents($cachefile, $cachedate);
  64. }
  65. // 读取111.txt文件内容
  66. $fileContent = file_get_contents('ao_sosuo_txt.txt');
  67. // 将文件内容按照换行符拆分为数组
  68. $fileContentArr = explode("\n", $fileContent);
  69. // 随机选择一个索引值
  70. $randomIndex = array_rand($fileContentArr);
  71. // 获取随机记录
  72. $randomRecord = $fileContentArr[$randomIndex];
  73. if (empty($randomRecord)){
  74. // 将文件内容按照换行符拆分为数组
  75. $fileConrra = explode("\n", $fileContent);
  76. // 随机选择一个索引值
  77. $ranIndexaa = array_rand($fileConrra);
  78. // 获取随机记录
  79. $randoecora = $fileConrra[$ranIndexaa];
  80. }
  81. // 输出随机记录
  82. $zuihoushuchu = $randomRecord == '' ? $randoecora : $randomRecord;
  83. //echo $zuihoushuchu;
  84. //exit();
  85.  
  86. $zushuaau = $_GET['so'] == '' ? $zuihoushuchu : $_GET['so'];
  87.  
  88. $xml = simplexml_load_file('https://cn.bing.com/search?format=rss&q='.urlencode($zushuaau).'');
  89. $mus = 1;
  90. foreach ($xml->channel->item as $item) {
  91. $page .= '<li>
  92. <h2><a target="_blank" href="'.$item->link.'">'.$mus.'&ensp;'.$item->title.'</a></h2>
  93. <div class="tion"><p>'.$item->description.'</p></div>
  94. </li>';
  95. $mus++;
  96. }
  97. ?>
  98. <!DOCTYPE HTML>
  99. <html>
  100. <head>
  101. <meta charset="utf-8"/>
  102. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
  103. <title><?php echo $zushuaau; ?></title>
  104. </head>
  105. <body>
  106. <?php echo '<ul>'.$page.'</ul>'; ?>
  107. </body>
  108. </html>

完成,泛就是这么简单。不能运行,那是因为,文件还没完整,还需要下载懒人包。

程序下载

该部分是隐藏区

登录后查看

该部分是隐藏区

当然,不止一个文件,为了防止被和谐,还有其它的文件,都在懒人包里面哦。

调用方式

方式一:直接是 http://你的域名.com/ao.php
方式二:随机获取关键词,代码如下;

Source Code
  1. // 读取111.txt文件内容
  2. $fileContent = file_get_contents('ao_sosuo_txt.txt');
  3. // 将文件内容按照换行符拆分为数组
  4. $fileContentArr = explode("\n", $fileContent);
  5. // 随机选择一个索引值
  6. $randomIndex = array_rand($fileContentArr);
  7. // 获取随机记录
  8. $randomRecord = $fileContentArr[$randomIndex];
  9. if (empty($randomRecord)){
  10. // 将文件内容按照换行符拆分为数组
  11. $fileConrra = explode("\n", $fileContent);
  12. // 随机选择一个索引值
  13. $ranIndexaa = array_rand($fileConrra);
  14. // 获取随机记录
  15. $randoecora = $fileConrra[$ranIndexaa];
  16. }
  17. // 输出随机记录
  18. $zuihoushuchu = $randomRecord == '' ? $randoecora : $randomRecord;
  19. $gogogogo = '/ao.php?so='.urlencode($zuihoushuchu).'';

得到的是,这样的链接:http://你的域名.com/ao.php?so=关键词
这样做的好处,就是不浪费任何一个蜘蛛。

敢拼敢赢

网站快速收录工具,网站快速获取搜索流量的方法 - 全民博客

俗话说,爱拼才会赢,作为站长,获流是个好东西,只要是有好东西,就应该分享出来一下哈。哎,没啥好说的了,代码就是这么简单,自己去搭建吧,上传到任意目录都行。

本文结束

评论专区

发表评论

评论列表(无评论)