Skip to content

Commit

Permalink
🐞 fix: 修复英雄联盟更新公告
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Dec 26, 2023
1 parent a439458 commit 029fed6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions routes/lol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 029fed6

Please sign in to comment.