首页
友链
壁纸
留言
今日热榜
更多
关于
时光
推荐
精品流量卡
Search
1
都二十多年了,你的梦为什么还没碎!
57,091 阅读
2
2022年5个好用的 BT/ 磁力链接下载工具推荐 |Windows 、安卓系统
37,417 阅读
3
nps内网穿透实现外网访问树莓派
32,429 阅读
4
实践利用宝塔建emlog个人博客-超详细【原创】
26,135 阅读
5
Typecho-Joe-Theme主题帮助文档
24,646 阅读
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
登录
Search
标签搜索
PHP
HTML
API
Javascript
源码
JS
Vue
Github
CloudFlare
接口
函数
SQL
ASP.NET
MVC
EF
T4模板
后台管理
CDN
微信小程序
MAC
韩小韩
累计撰写
262
篇文章
累计收到
1,308
条评论
首页
栏目
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
页面
友链
壁纸
留言
今日热榜
关于
时光
推荐
精品流量卡
搜索到
2
篇与
百度热点
的结果
2022-12-06
今日热榜HotList-Web前端开源Vue - (聚合热榜)
{message type="info" content="每日热榜前端配合后端(韩小韩聚合热榜API)一起使用,后端源接口为官方接口。"/}环境需求Nodejs >14.1.0使用框架VueElement-UI页面AND源码截图{gird column="2" gap="15"}{gird-item} {/gird-item}{gird-item}{/gird-item}{/gird}源码地址{cloud title="HotList-Web" type="github" url="https://github.com/uxiaohan/HotList-Web" password=""/}{callout color="#f0ad4e"}后端配合 韩小韩API 聚合热榜API 使用.或者自建API使用.源码自行编译 或 直接上传 dist文件夹内已编译文件.{/callout}成品演示{abtn icon="fa-link" color="#ff6800" href="https://hot.vvhan.com/" radius="" content="今日热榜 HotList-Web"/} {abtn icon="fa-link" color="#00d5ff" href="https://api.vvhan.com/hotlist.html" radius="" content="韩小韩API 聚合热榜API"/}希望给个 Star 😬
2022年12月06日
1,287 阅读
2 评论
8 点赞
2022-11-02
知乎热榜API、百度热点API、微博热搜API(开源)- 聚合热榜API开源
{message type="info" content="源码为一次源码,源接口为官方接口,与 韩小韩API(Api.Vvhan.Com)使用接口完全相同,上传即用!"/}环境需求PHP 5.4及以上使用方式:上传即用知乎热榜API源码<?php // 知乎热榜 热度 function zhihuHot() { $_resHtml = str_replace(["\n", "\r", " "], '', vvhanCurl('https://www.zhihu.com/hot', ['User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1'], 'https://www.zhihu.com')); preg_match('/<scriptid=\"js-initialData\"type=\"text\/json\">(.*?)<\/script>/', $_resHtml, $_resHtmlArr); $jsonRes = json_decode($_resHtmlArr[1], true); $tempArr = []; foreach ($jsonRes['initialState']['topstory']['hotList'] as $k => $v) { array_push($tempArr, [ 'index' => $k + 1, 'title' => $v['target']['titleArea']['text'], 'desc' => $v['target']['excerptArea']['text'], 'pic' => $v['target']['imageArea']['url'], 'hot' => $v['target']['metricsArea']['text'], 'url' => $v['target']['link']['url'], 'mobilUrl' => $v['target']['link']['url'] ]); } return [ 'success' => true, 'title' => '知乎热榜', 'subtitle' => '热度', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } ?>百度热点API源码<?php // 百度热点 指数 function baiduredian() { $_resHtml = str_replace(["\n", "\r", " "], '', vvhanCurl('https://top.baidu.com/board?tab=realtime', null)); preg_match('/<!--s-data:(.*?)-->/', $_resHtml, $_resHtmlArr); $jsonRes = json_decode($_resHtmlArr[1], true); return $jsonRes; $tempArr = []; foreach ($jsonRes['data']['cards'] as $v) { foreach ($v['content'] as $k => $_v) { array_push($tempArr, [ 'index' => $k + 1, 'title' => $_v['word'], 'desc' => $_v['desc'], 'pic' => $_v['img'], 'url' => $_v['url'], 'hot' => $_v['hotScore'] . 'W个内容', 'mobilUrl' => $_v['appUrl'] ]); } } return [ 'success' => true, 'title' => '百度热点', 'subtitle' => '指数', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } ?>微博热搜API源码<?php // 微博 热搜榜 function wbresou() { $_md5 = md5(time()); $cookie = "Cookie: {$_md5}:FG=1"; $jsonRes = json_decode(vvhanCurl('https://weibo.com/ajax/side/hotSearch', null, $cookie, "https://s.weibo.com"), true); $tempArr = []; foreach ($jsonRes['data']['realtime'] as $k => $v) { array_push($tempArr, [ 'index' => $k + 1, 'title' => $v['note'], 'hot' => $v['num'] . '万', 'url' => "https://s.weibo.com/weibo?q={$v['word_scheme']}&t=31&band_rank=12&Refer=top", 'mobilUrl' => "https://s.weibo.com/weibo?q={$v['word_scheme']}&t=31&band_rank=12&Refer=top" ]); } return [ 'success' => true, 'title' => '微博', 'subtitle' => '热搜榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } ?>三合一聚合源码{callout color="#f0ad4e"}知乎热榜、百度热点、微博热搜 API三合一聚合源码{/callout}<?php /* * @Author: Han * @Date: 2022-11-02 13:45:21 * @LastEditors: Han * @LastEditTime: 2022-11-02 13:52:21 * @FilePath: \WWW\hotlist.php * @NetWork: 韩小韩博客 www.vvhan.com */ error_reporting(0); header("Access-Control-Allow-Origin:*"); header("Content-type:application/json; charset=utf-8"); date_default_timezone_set("Asia/Shanghai"); class VvhanApi { // 知乎热榜 热度 public function zhihuHot() { $_resHtml = str_replace(["\n", "\r", " "], '', $this->vvhanCurl('https://www.zhihu.com/hot', ['User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1'], 'https://www.zhihu.com')); preg_match('/<scriptid=\"js-initialData\"type=\"text\/json\">(.*?)<\/script>/', $_resHtml, $_resHtmlArr); $jsonRes = json_decode($_resHtmlArr[1], true); $tempArr = []; foreach ($jsonRes['initialState']['topstory']['hotList'] as $k => $v) { array_push($tempArr, [ 'index' => $k + 1, 'title' => $v['target']['titleArea']['text'], 'desc' => $v['target']['excerptArea']['text'], 'pic' => $v['target']['imageArea']['url'], 'hot' => $v['target']['metricsArea']['text'], 'url' => $v['target']['link']['url'], 'mobilUrl' => $v['target']['link']['url'] ]); } return [ 'success' => true, 'title' => '知乎热榜', 'subtitle' => '热度', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // 微博 热搜榜 public function wbresou() { $_md5 = md5(time()); $cookie = "Cookie: {$_md5}:FG=1"; $jsonRes = json_decode($this->vvhanCurl('https://weibo.com/ajax/side/hotSearch', null, $cookie, "https://s.weibo.com"), true); $tempArr = []; foreach ($jsonRes['data']['realtime'] as $k => $v) { array_push($tempArr, [ 'index' => $k + 1, 'title' => $v['note'], 'hot' => $v['num'] . '万', 'url' => "https://s.weibo.com/weibo?q={$v['word_scheme']}&t=31&band_rank=12&Refer=top", 'mobilUrl' => "https://s.weibo.com/weibo?q={$v['word_scheme']}&t=31&band_rank=12&Refer=top" ]); } return [ 'success' => true, 'title' => '微博', 'subtitle' => '热搜榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // 百度热点 指数 public function baiduredian() { $_resHtml = str_replace(["\n", "\r", " "], '', $this->vvhanCurl('https://top.baidu.com/board?tab=realtime', null)); preg_match('/<!--s-data:(.*?)-->/', $_resHtml, $_resHtmlArr); $jsonRes = json_decode($_resHtmlArr[1], true); return $jsonRes; $tempArr = []; foreach ($jsonRes['data']['cards'] as $v) { foreach ($v['content'] as $k => $_v) { array_push($tempArr, [ 'index' => $k + 1, 'title' => $_v['word'], 'desc' => $_v['desc'], 'pic' => $_v['img'], 'url' => $_v['url'], 'hot' => $_v['hotScore'] . 'W个内容', 'mobilUrl' => $_v['appUrl'] ]); } } return [ 'success' => true, 'title' => '百度热点', 'subtitle' => '指数', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } private function vvhanCurl($url, $header = [ "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Accept-Encoding: gzip, deflate, br", "Accept-Language: zh-CN,zh;q=0.9", "Connection: keep-alive", "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1" ], $cookie = null, $refer = 'https://www.baidu.com') { $ip = rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255) . '.' . rand(0, 255); $header[] = "CLIENT-IP:" . $ip; $header[] = "X-FORWARDED-FOR:" . $ip; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //设置传输的 url curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //发送 http 报头 curl_setopt($ch, CURLOPT_COOKIE, $cookie); //设置Cookie curl_setopt($ch, CURLOPT_REFERER, $refer); //设置Referer curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); // 解码压缩文件 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // 从证书中检查SSL加密算法是否存在 curl_setopt($ch, CURLOPT_TIMEOUT, 5); // 设置超时限制防止死循环 $output = curl_exec($ch); curl_close($ch); return $output; } } $_type = isset($_GET['type']) ? $_GET['type'] : ''; $API = new VvhanApi; switch ($_type) { case 'baidu': $_res = $API->baiduredian(); break; case 'zhihu': $_res = $API->zhihuHot(); break; case 'weibo': $_res = $API->wbresou(); break; default: $_res = ['success' => false, 'message' => '参数不完整']; break; } $_res['copyright'] = '韩小韩博客 www.vvhan.com'; exit(json_encode($_res, JSON_UNESCAPED_UNICODE)); ?>成品使用{callout color="#f0ad4e"}如果你懒得搭建,可使用 韩小韩API(Api.Vvhan.Com)提供的 聚合热榜API{/callout}{abtn icon="fa-link" color="#4eda9d" href="https://api.vvhan.com/hotlist.html" radius="" content="热榜热搜各站热榜聚合API"/}
2022年11月02日
2,132 阅读
11 评论
1 点赞