搏一搏,单车变摩托,怎么样,网站才能快速获权,怎么样,网站才能快速获取流量,怎么样......就是快速提升网站权重和流量。下面,小千就写一个代码,这个代码只需一个文件,你可以认为是泛程序、泛目录、泛工具等等,总之,就是快速获取收录、快速获取关键词、快速获取网站流量等等。
教程开始
新建一个 ao.php 文件,代码如下
PHP
- <?php
- error_reporting(0);
- header('Content-type:text/html;charset=utf-8');
- ob_start('ob_gzhandler');
- date_default_timezone_set('Asia/Shanghai');
- $ititlesearc = $_GET['so'] == '' ? '' : '<title>'.$_GET['so'].'</title>';
- //只给指定蜘蛛抓取
- $userAgent = $_SERVER['HTTP_USER_AGENT'];//获取User Agent信息
- $searchEngines = array('Baiduspider','bingbot','Sogou','Bytespider','YisouSpider');//指定蜘蛛访问
- $isSearchEngineBot = false;
- foreach ($searchEngines as $searchEngine) {
- if (stripos($userAgent, $searchEngine) !== false) {
- $isSearchEngineBot = true;
- break;
- }
- }
- if ($isSearchEngineBot == false) {
- echo $ititlesearc.'<p style="display:flex;align-items:center;justify-content:center;height:98%;cursor:pointer;">本地法律要求通知,部分结果未予显示。 <a href="/">返回首页</a></p>';
- exit();
- }
- //只给指定蜘蛛抓取
- //先设置一个缓存文件 来保存当天缓存日期
- $cachefile = 'ao_sosuo_cache.txt';
- // 检查缓存文件是否存在
- if (!file_exists($cachefile)) {
- //不存在就创建缓存文件
- fopen($cachefile, 'w');
- }
- // 缓存文件 保存一天 获取当前日期
- $cachedate = date('H');
- // 读取缓存文件的日期
- $cacheddate = file_get_contents($cachefile);
- // 检查缓存是否过期
- if ($cacheddate != $cachedate) {
- //缓存未过期,直接读取缓存文件并输出
- require_once('ao_sosuo_inc.php');
- $surlaa = 'https://top.baidu.com/board?tab=realtime';
- $lines_array = file($surlaa);
- $lines_string = implode('', $lines_array);
- eregi("(.*)",$lines_string, $ahead);
- $rurl = $ahead[0];
- if ($ahead[0] == ''){$rurl = fget($surlaa,5);}
- $szzaa = '#,"query":"(.*?)",#';
- preg_match_all($szzaa,$rurl,$aaaaa);
- $one = $aaaaa[1];//标题
- //echo $rurl;
- $i=0;
- foreach ($one as $ni=>$cs) {
- if ($i<100) {
- $y = $i+1;//序号
- $soss .= $cs."\n";
- $i ++;
- }
- }
- $three = trim($soss);
- if (!empty($three)){
- $contentFile = fopen(dirname(__FILE__).'/ao_sosuo_txt.txt', 'w');
- fwrite($contentFile, $three);//写入数据内容
- fclose($contentFile);
- }
- file_put_contents($cachefile, $cachedate);
- }
- // 读取111.txt文件内容
- $fileContent = file_get_contents('ao_sosuo_txt.txt');
- // 将文件内容按照换行符拆分为数组
- $fileContentArr = explode("\n", $fileContent);
- // 随机选择一个索引值
- $randomIndex = array_rand($fileContentArr);
- // 获取随机记录
- $randomRecord = $fileContentArr[$randomIndex];
- if (empty($randomRecord)){
- // 将文件内容按照换行符拆分为数组
- $fileConrra = explode("\n", $fileContent);
- // 随机选择一个索引值
- $ranIndexaa = array_rand($fileConrra);
- // 获取随机记录
- $randoecora = $fileConrra[$ranIndexaa];
- }
- // 输出随机记录
- $zuihoushuchu = $randomRecord == '' ? $randoecora : $randomRecord;
- //echo $zuihoushuchu;
- //exit();
- $zushuaau = $_GET['so'] == '' ? $zuihoushuchu : $_GET['so'];
- $xml = simplexml_load_file('https://cn.bing.com/search?format=rss&q='.urlencode($zushuaau).'');
- $mus = 1;
- foreach ($xml->channel->item as $item) {
- $page .= '<li>
- <h2><a target="_blank" href="'.$item->link.'">'.$mus.' '.$item->title.'</a></h2>
- <div class="tion"><p>'.$item->description.'</p></div>
- </li>';
- $mus++;
- }
- ?>
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
- <title><?php echo $zushuaau; ?></title>
- </head>
- <body>
- <?php echo '<ul>'.$page.'</ul>'; ?>
- </body>
- </html>
完成,泛就是这么简单。不能运行,那是因为,文件还没完整,还需要下载懒人包。
程序下载
当然,不止一个文件,为了防止被和谐,还有其它的文件,都在懒人包里面哦。
调用方式
方式一:直接是 http://你的域名.com/ao.php
方式二:随机获取关键词,代码如下;
Source Code
- // 读取111.txt文件内容
- $fileContent = file_get_contents('ao_sosuo_txt.txt');
- // 将文件内容按照换行符拆分为数组
- $fileContentArr = explode("\n", $fileContent);
- // 随机选择一个索引值
- $randomIndex = array_rand($fileContentArr);
- // 获取随机记录
- $randomRecord = $fileContentArr[$randomIndex];
- if (empty($randomRecord)){
- // 将文件内容按照换行符拆分为数组
- $fileConrra = explode("\n", $fileContent);
- // 随机选择一个索引值
- $ranIndexaa = array_rand($fileConrra);
- // 获取随机记录
- $randoecora = $fileConrra[$ranIndexaa];
- }
- // 输出随机记录
- $zuihoushuchu = $randomRecord == '' ? $randoecora : $randomRecord;
- $gogogogo = '/ao.php?so='.urlencode($zuihoushuchu).'';
得到的是,这样的链接:http://你的域名.com/ao.php?so=关键词
这样做的好处,就是不浪费任何一个蜘蛛。
敢拼敢赢
俗话说,爱拼才会赢,作为站长,获流是个好东西,只要是有好东西,就应该分享出来一下哈。哎,没啥好说的了,代码就是这么简单,自己去搭建吧,上传到任意目录都行。
本文结束
评论专区
发表评论
评论列表(无评论)