refactor(utils) remove code

This commit is contained in:
kyuuseiryuu 2026-01-29 22:11:05 +09:00
parent 0fed35fb48
commit 0407ee1929

View File

@ -1,32 +1,14 @@
import type { IEventInfo, Player, XCXMember } from "./types"; import type { IEventInfo, Player } from "./types";
import * as cheerio from "cheerio"; import * as cheerio from "cheerio";
import fs from 'fs';
import path from 'path';
import { chunk } from 'lodash'; import { chunk } from 'lodash';
import type { XCXProfile } from "./types/profile";
import type { XCXTag } from "./types/tag";
export const BASE_URL = `https://kaiqiuwang.cc`; export const BASE_URL = `https://kaiqiuwang.cc`;
/**
*
token:
XX-Device-Type: wxapp
content-type: application/json
Accept-Encoding: gzip,compress,br,deflate
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.68(0x1800442a) NetType/WIFI Language/zh_CN
Referer: https://servicewechat.com/wxff09fb0e92aa456a/464/page-frame.html
*/
/** /**
* @param tagid ID * @param tagid ID
*/ */
export async function listEvent(tagid: string): Promise<IEventInfo[]> { export async function listEvent(tagid: string): Promise<IEventInfo[]> {
return parseEventList(await fetchEventListHTML(tagid)); return parseEventList(await fetchEventListHTML(tagid));
return parseEventList(
fs.readFileSync(
path.resolve(__dirname, '..', '__test__', 'data', 'view-event.html')
).toString()
);
} }
/** /**
@ -95,13 +77,6 @@ export function parseEventInfo(html: string) {
export async function getMatchInfo(matchId: string) { export async function getMatchInfo(matchId: string) {
return parseEventInfo(await fetchEventContentHTML(matchId)); return parseEventInfo(await fetchEventContentHTML(matchId));
return parseEventInfo(
fs
.readFileSync(
path.resolve(__dirname, '..', '__test__', 'data', 'view-event-content.html')
)
.toString()
);
} }
export function sneckGroup(size: number, groupLen: number) { export function sneckGroup(size: number, groupLen: number) {