首页 » SEO优化 » strendwithphp技巧_百度搜狗热点词华集

strendwithphp技巧_百度搜狗热点词华集

访客 2024-12-07 0

扫一扫用手机浏览

文章目录 [+]

一、百度热搜

描述:百度热搜以数亿用户海量的真实数据为根本,通过专业的数据挖掘方法,打算关键词的热搜指数,旨在建立威信、全面、热门、时效的各种关键词排行榜,引领热词阅读时期。

网址:https://top.baidu.com/board

strendwithphp技巧_百度搜狗热点词华集

二、搜狗热搜榜

描述:搜狗热搜榜包括实时热点、热门电影、热点电视剧、热门综艺、热门动漫、热门小说、热门游戏、热门音乐、热门汽车与热门人物等。

strendwithphp技巧_百度搜狗热点词华集
(图片来自网络侵删)

网址:https://top.baidu.com/board

三、搜狗百度热点词采集

直接将下面的PHP代码保存到php文件中,然后再创建相对位置下的./cuowucom/redianci/,也就可以直接把热点词输出在浏览器中,同时保存到这个文件夹下新天生的txt中。

<?php// 搜狗百度热点采集天生:$strchulis="";$sgresult="";$baidustr1 = file_get_contents("http://top.baidu.com/buzz/top10.html"); //民生时时热点关键词$baidustr2 = file_get_contents("http://top.baidu.com/buzz?b=11&c=513&fr=topcategory_c513"); //体育时时热点关键词$baidustr3 = file_get_contents("http://top.baidu.com/buzz?b=344&c=513&fr=topcategory_c513"); //娱乐时时热点关键词for ($x=1; $x<=3; $x++) {$sgstr1 = file_get_contents("http://top.sogou.com/hot/sevendsnews_".$x.".html"); //搜狗3页七日热点$sgstr2 = file_get_contents("http://top.sogou.com/hot/shishi_".$x.".html"); //搜狗3页时时热点$sgstr3 = file_get_contents("http://top.sogou.com/movie/all_".$x.".html"); //搜狗电影时时热点$sgstr4 = file_get_contents("http://top.sogou.com/tvplay/all_".$x.".html"); //搜狗电视剧时时热点$sgstr5 = file_get_contents("http://top.sogou.com/tvshow/all_".$x.".html"); //搜狗综艺时时热点$sgstr6 = file_get_contents("http://top.sogou.com/animation/all_".$x.".html"); //搜狗动漫时时热点$sgstr7 = file_get_contents("http://top.sogou.com/book/all_".$x.".html"); //搜狗小说时时热点$sgstr8 = file_get_contents("http://top.sogou.com/song/newsong_".$x.".html"); //搜狗音乐时时热点$sgstr9 = file_get_contents("http://top.sogou.com/game/all_".$x.".html"); //搜狗游戏时时热点$sgstr10 = file_get_contents("http://top.sogou.com/auto/all_".$x.".html"); //搜狗汽车时时热点$sgstr11 = file_get_contents("http://top.sogou.com/people/all_".$x.".html"); //搜狗人物时时热点// for循环过滤搜狗for ($i=1; $i<=11; $i++) {preg_match_all('/<p class=\"p1\".?>.?<\/p>/ism', ${"sgstr".$i}, $matchestop); //搜狗过滤函数preg_match_all('/<p class=\"p3\".?>.?<\/p>/ism', ${"sgstr".$i}, $matchesbottom); //搜狗过滤函数$strtop = join("\r\n", $matchestop[0]);//搜狗\r\n换行符,拼接起来$strbottom = join("\r\n", $matchesbottom[0]);//搜狗\r\n换行符,拼接起来$sgresult.=$strtop.$strbottom;}$baidustr = mb_convert_encoding(${"baidustr".$x}, 'UTF-8', 'GB2312');//百度获取内容转码utf-8preg_match_all('/<a class=\"list-title\".?>.?<\/a>/ism', $baidustr, $matches); //百度过滤函数$baidustr = join("\r\n", $matches[0]);//结果百度采集\r\n换行符,拼接起来$sgstrend=$sgresult.$baidustr;//结果搜狗采集关键词换行$strchuli = strip_tags($sgstrend);//去掉html标签。
$strchulis.=$strchuli;//赋值给新变量}echo $strchulis;//输出file_put_contents('./cuowucom/redianci/'.date("Y-m-d").'.txt', $strchulis);//存入txt?>

以上便是缺点博客(https://cuowu.com/)分享的内容为《百度搜狗热点词采集》。
感谢您的阅读。
更多原创文章搜索“缺点博客”。

标签:

相关文章

znedphp情况技巧_每 一 天 都 爱 你

如果信念有颜色,那一定是中国红。这抹红,是奔赴星辰大海的一腔热血;这抹红,是为之不懈奋斗的小儿百姓初心;这抹红,是亿万中原儿女的共...

SEO优化 2024-12-09 阅读0 评论0