2 Commits

Author SHA1 Message Date
imsyy
029fed603b 🐞 fix: 修复英雄联盟更新公告 2023-12-26 15:58:29 +08:00
imsyy
a4394588c1 feat: 优化 Docker 大小 2023-12-06 12:25:09 +08:00
4 changed files with 8 additions and 12 deletions

View File

@@ -1,13 +1,10 @@
FROM node:16
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
RUN npm install --production
COPY . .
EXPOSE 6688
CMD ["npm", "start"]

View File

@@ -85,9 +85,9 @@ docker run -p 6688:6688 -d dailyhot-api
```bash
// 拉取
docker pull imsyy/dailyhot-api:1.0.4
docker pull imsyy/dailyhot-api:1.0.5
// 运行
docker run -p 6688:6688 -d imsyy/dailyhot-api:1.0.4
docker run -p 6688:6688 -d imsyy/dailyhot-api:1.0.5
```
## Vercel 部署

View File

@@ -1,6 +1,6 @@
{
"name": "dailyhot_api",
"version": "1.0.4",
"version": "1.0.5",
"description": "一个今日热榜",
"main": "index.js",
"scripts": {

View File

@@ -18,16 +18,15 @@ let updateTime = new Date().toISOString();
// 调用路径
const url =
"https://apps.game.qq.com/cmc/zmMcnTargetContentList?r0=jsonp&page=1&num=16&target=24&source=web_pc&r1=jQuery191002324053053181463_1687855508930&_=1687855508933";
"https://apps.game.qq.com/cmc/zmMcnTargetContentList?r0=jsonp&page=1&num=16&target=24&source=web_pc";
// 数据处理
const getData = (data) => {
if (!data) return [];
const dataList = [];
try {
const pattern = /jQuery191002324053053181463_1687855508930\((.*?)\)/s;
const matchResult = data.match(pattern);
const jsonObject = JSON.parse(matchResult[1])["data"].result;
const match = data.match(/callback\((.*)\)/);
const jsonObject = JSON.parse(match[1]).data.result;
jsonObject.forEach((v) => {
dataList.push({
title: v.sTitle,