refactor(utils) remove code
This commit is contained in:
parent
0fed35fb48
commit
0407ee1929
27
src/utils.ts
27
src/utils.ts
@ -1,32 +1,14 @@
|
||||
import type { IEventInfo, Player, XCXMember } from "./types";
|
||||
import type { IEventInfo, Player } from "./types";
|
||||
import * as cheerio from "cheerio";
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { chunk } from 'lodash';
|
||||
import type { XCXProfile } from "./types/profile";
|
||||
import type { XCXTag } from "./types/tag";
|
||||
|
||||
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
|
||||
*/
|
||||
export async function listEvent(tagid: string): Promise<IEventInfo[]> {
|
||||
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) {
|
||||
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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user