要早点睡哦
你好小铭云,我是小明云
在东京的天空上,我们决定性的改变了世界的模样。
首页
留言板
关于筱铭云
免责声明
推荐
筱铭引导页
朋友圈动态
Search
1
筱铭号卡联盟专业的号卡平台开启通讯新时代!
4,046 阅读
2
每天60秒读懂世界每天自动实时播报更新-筱铭云博客
3,962 阅读
3
欢迎使用 Typecho
3,960 阅读
4
本站同款主题 Typecho — Joe主题
3,413 阅读
5
你要接受这世上突如其来的失去
3,391 阅读
筱铭云
诗和远方
心灵鸡汤
Typecho
halo
网络教程
网络知识
程序软件
登录
/
注册
Search
标签搜索
筱铭云博客
筱铭云
源码
Joe主题
Typecho
代码
彩虹
html
程序
工具箱
API
我爱代挂
爱代挂
halo
每天60秒
网站代码
python
反诈app
反诈中心
Joe
Aree丶筱铭云
累计撰写
44
篇文章
累计收到
4
条评论
️
首页
分类
筱铭云
诗和远方
心灵鸡汤
Typecho
halo
网络教程
网络知识
程序软件
页面
留言板
关于筱铭云
免责声明
推荐
筱铭引导页
朋友圈动态
用户登录
登录丨注册
搜索到
3
篇与
的结果
2023-02-08
CloudZA-API 一款开源的API内容管理系统
源码介绍CloudZA-API一款稳定、快速的免费API数据接口服务,CloudZA-API是一款简洁好看的api管理系统,支持添加外部API等功能。程序截图安装教程:PHP版本 8.0Mysql 5.6及以上将程序上传到网站目录配置伪静态规则访问domain进入到安装指引伪静态:if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; }{anote icon="fa-github" href="https://github.com/iCloudZA/CloudZA_API" type="info" content="本地下载"/}
2023年02月08日
2,039 阅读
0 评论
95 点赞
2023-01-30
知乎热榜API、百度热点API、微博热搜API(开源)- 聚合热榜API开源
环境需求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 ];}?> 三合一聚合源码(知乎/微博/百度/历史上的今天/抖音/哔哩哔哩(热搜+全站日榜)/少数派/36氪/CSDN)<?php /** * 热搜榜 (知乎/微博/百度/历史上的今天/抖音/哔哩哔哩(热搜+全站日榜)/少数派/36氪/CSDN) */ header("Access-Control-Allow-Origin:*"); header("Content-type:application/json; charset=utf-8"); date_default_timezone_set("Asia/Shanghai"); class Api { // 少数派 热榜 public function sspai() { $jsonRes = json_decode($this->Curl('https://sspai.com/api/v1/article/tag/page/get?limit=100000&tag=%E7%83%AD%E9%97%A8%E6%96%87%E7%AB%A0', null, null, "https://sspai.com"), true); $tempArr = []; foreach ($jsonRes['data'] as $k => $v) { array_push($tempArr, [ 'index' => $k +1, 'title' => $v['title'], 'createdAt' => date('Y-m-d', $v['released_time']), 'other' => $v['author']['nickname'], 'like_count' => $v['like_count'], 'comment_count' => $v['comment_count'], 'url' => 'https://sspai.com/post/'.$v['id'], 'mobilUrl' => 'https://sspai.com/post/'.$v['id'] ]); } return [ 'success' => true, 'title' => '少数派', 'subtitle' => '热榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // CSDN 头条榜 public function csdn() { $_resHtml = $this->Curl('https://www.csdn.net', null, "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", "https://www.csdn.net"); preg_match('/window.__INITIAL_STATE__=(.*?);<\/script>/', $_resHtml, $_resHtmlArr); $jsonRes = json_decode($_resHtmlArr[1],true); $tempArr = []; //头条 foreach ($jsonRes['pageData']['data']['Headimg'] as $k => $v) { array_push($tempArr, [ 'index' => $k +1, 'title' => $v['title'], 'url' => $v['url'], 'mobilUrl' => $v['url'] ]); } //头条1 foreach ($jsonRes['pageData']['data']['www-Headlines'] as $k => $v) { array_push($tempArr, [ 'index' => $k +17, 'title' => $v['title'], 'url' => $v['url'], 'mobilUrl' => $v['url'] ]); } //头条2 foreach ($jsonRes['pageData']['data']['www-headhot'] as $k => $v) { array_push($tempArr, [ 'index' => $k +48, 'title' => $v['title'], 'url' => $v['url'], 'mobilUrl' => $v['url'] ]); } return [ 'success' => true, 'title' => 'CSDN', 'subtitle' => '头条榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } //百度百科 历史上的今天 public function history() { $month=date('m',time() ); $day=date('d',time() ); //当前年月日 $today = date('Y年m月d日'); //获取接口数据 $jsonRes = json_decode($this->Curl('https://baike.baidu.com/cms/home/eventsOnHistory/'.$month.'.json', null, null, "https://baike.baidu.com"), true); $tempArr = []; //统计当日总数 $countnum = count($jsonRes[$month][$month.$day])-1; foreach ($jsonRes[$month][$month.$day] as $k => $v) { array_push($tempArr, [ 'index' => $k +1, 'title' => $v['year'].'年-'.strip_tags($v['title']), 'url' => 'https://www.douyin.com/search/'.urlencode($v['title']), 'mobilUrl' => 'https://www.douyin.com/search/'.urlencode($v['title']) ]); } return [ 'success' => true, 'title' => '百度百科', 'subtitle' => '历史上的今天', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // 抖音 热搜榜 public function douyin() { $jsonRes = json_decode($this->Curl('https://www.iesdouyin.com/web/api/v2/hotsearch/billboard/word/', null, null, "https://www.douyin.com"), true); $tempArr = []; foreach ($jsonRes['word_list'] as $k => $v) { array_push($tempArr, [ 'index' => $k +1, 'title' => $v['word'], 'hot' => round($v['hot_value']/10000,1).'万', 'url' => 'https://www.douyin.com/search/'.urlencode($v['word']), 'mobilUrl' => 'https://www.douyin.com/search/'.urlencode($v['word']) ]); } return [ 'success' => true, 'title' => '抖音', 'subtitle' => '热搜榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // 哔哩哔哩 全站日榜 public function bilibili_rankall() { $jsonRes = json_decode($this->Curl('https://api.bilibili.com/x/web-interface/ranking/v2?rid=0&type=all', null, null, "https://www.bilibili.com"), true); $tempArr = []; foreach ($jsonRes['data']['list'] as $k => $v) { array_push($tempArr, [ 'index' => $k +1, 'title' => $v['title'], 'pic' => $v['pic'], 'desc' => $v['desc'], 'hot' => round($v['stat']['view']/10000,1).'万', 'url' => $v['short_link'], 'mobilUrl' => $v['short_link'] ]); } return [ 'success' => true, 'title' => '哔哩哔哩', 'subtitle' => '全站日榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // 哔哩哔哩 热搜榜 public function bilibili_hot() { $jsonRes = json_decode($this->Curl('https://app.bilibili.com/x/v2/search/trending/ranking', null, null, "https://www.bilibili.com"), true); $tempArr = []; //return $jsonRes; foreach ($jsonRes['data']['list'] as $k => $v) { array_push($tempArr, [ 'index' => $v['position'], 'title' => $v['keyword'], 'url' => 'https://search.bilibili.com/all?keyword='.$v['keyword'].'&order=click', 'mobilUrl' => 'https://search.bilibili.com/all?keyword='.$v['keyword'].'&order=click' ]); } return [ 'success' => true, 'title' => '哔哩哔哩', 'subtitle' => '热搜榜', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } // 知乎热榜 热度 public function zhihuHot() { $jsonRes = json_decode($this->Curl('https://www.zhihu.com/api/v3/feed/topstory/hot-lists/total?limit=50&desktop=true', null, null, "https://www.zhihu.com"), true); $tempArr = []; foreach ($jsonRes['data'] as $k => $v) { preg_match('/\d+/', $v['detail_text'], $hot); array_push($tempArr, [ 'index' => $k + 1, 'title' => $v['target']['title'], 'hot' => $hot[0].'万', 'url' => 'https://www.zhihu.com/question/'.urlencode($v['target']['id']), 'mobilUrl' => 'https://www.zhihu.com/question/'.urlencode($v['target']['id']) ]); } 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->Curl('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' => round($v['num']/10000,1).'万', 'url' => "https://s.weibo.com/weibo?q=".$v['note']."&Refer=index", 'mobilUrl' => "https://s.weibo.com/weibo?q=".$v['note']."&Refer=index" ]); } 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->Curl('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' => round($_v['hotScore']/10000,1).'万', 'mobilUrl' => $_v['appUrl'] ]); } } return [ 'success' => true, 'title' => '百度热点', 'subtitle' => '指数', 'update_time' => date('Y-m-d h:i:s', time()), 'data' => $tempArr ]; } private function Curl($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 Api; switch ($_type) { case 'baidu': $_res = $API->baiduredian(); break; case 'zhihu': $_res = $API->zhihuHot(); break; case 'weibo': $_res = $API->wbresou(); break; case 'bilihot': $_res = $API->bilibili_hot(); break; case 'biliall': $_res = $API->bilibili_rankall(); break; case 'douyin': $_res = $API->douyin(); break; case 'history': $_res = $API->history(); break; case 'csdn': $_res = $API->csdn(); break; case 'sspai': $_res = $API->sspai(); break; default: $_res = ['success' => false, 'message' => '参数不完整']; break; } $_res['copyright'] = '聚合热搜榜'; exit(json_encode($_res,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)); ?>
2023年01月30日
2,212 阅读
0 评论
98 点赞
2022-12-27
制作一个简单的一言API
前言:通过调用文本任意一行的句子,实现简单的一言api,无后台返回数据,只需把文字写到api.txt中供其调用。代码:<?php //获取句子文件的绝对路径 $path = dirname(__FILE__); $file = file($path."/api.txt"); //随机读取一行 $arr = mt_rand( 0, count( $file ) - 1 ); $content = trim($file[$arr]); //编码判断,用于输出相应的响应头部编码 if (isset($_GET['charset']) && !empty($_GET['charset'])) { $charset = $_GET['charset']; if (strcasecmp($charset,"gbk") == 0 ) { $content = mb_convert_encoding($content,'gbk', 'utf-8'); } } else { $charset = 'utf-8'; } //格式化判断,输出js或纯文本 if ($_GET['encode'] === 'js') { echo "function api(){document.write('" . $content ."');}"; }else if($_GET['encode'] === 'json'){ header('Content-type:text/json'); $content = array('text'=>$content); echo json_encode($content, JSON_UNESCAPED_UNICODE); }else { echo $content; } ?>题跋:新建一个api.txt文本一行一个句子,如果自己没有可以下方评论联系我接口参数:**charset//字符编码(gbk/utf-8) encode//返回类型(text/js/json)**
2022年12月27日
1,880 阅读
0 评论
34 点赞