Auto commit: 2026-03-26 01:03
This commit is contained in:
@@ -24,4 +24,8 @@ export type HotListItem = {
|
|||||||
|
|
||||||
## hotnow 模块
|
## hotnow 模块
|
||||||
|
|
||||||
单独的 api 的模块,纯粹负责获取数据,不涉及任何 UI 相关的东西。这样做的好处是可以让数据获取和 UI 展示解耦,方便后续维护和扩展。
|
单独的 api 的模块,纯粹负责获取数据,不涉及任何 UI 相关的东西。这样做的好处是可以让数据获取和 UI 展示解耦,方便后续维护和扩展。
|
||||||
|
|
||||||
|
## 其他模块
|
||||||
|
|
||||||
|
使用 bun 运行
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -29,7 +29,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.code === 0) {
|
if (responseBody.code === 0) {
|
||||||
const result: HotListItem[] = responseBody.data?.hotRankList.map((v) => {
|
const result: HotListItem[] = responseBody.data?.hotRankList.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.itemId,
|
id: v.itemId,
|
||||||
title: v?.templateMaterial?.widgetTitle,
|
title: v?.templateMaterial?.widgetTitle,
|
||||||
@@ -48,4 +48,6 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
}
|
||||||
|
|||||||
14
src/hotnow/36kr/origin.d.ts
vendored
Normal file
14
src/hotnow/36kr/origin.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
itemId: number;
|
||||||
|
itemType: number;
|
||||||
|
templateMaterial: {
|
||||||
|
widgetTitle: string;
|
||||||
|
widgetImage: string;
|
||||||
|
statRead: number;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
route: string;
|
||||||
|
siteId: number;
|
||||||
|
publishTime: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端搜索链接
|
url: string; // PC 端搜索链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,16 +15,16 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.success) {
|
if (responseBody.success) {
|
||||||
const result: HotListItem[] = responseBody.data.cards[0]?.content[0]?.content.map((v) => {
|
const result: HotListItem[] = responseBody.data.cards[0]?.content[0]?.content.map((v, idx) => {
|
||||||
return {
|
return {
|
||||||
id: v.index,
|
id: v.index ?? v.isTop ? idx + 1 : v.index,
|
||||||
title: v.word,
|
title: v.word,
|
||||||
label: v.newHotName,
|
label: v.newHotName,
|
||||||
url: `https://www.baidu.com/s?wd=${encodeURIComponent(v.word)}`,
|
url: `https://www.baidu.com/s?wd=${encodeURIComponent(v.word)}`,
|
||||||
mobileUrl: v.url,
|
mobileUrl: v.url,
|
||||||
originData: v,
|
originData: v,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
@@ -33,4 +33,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
10
src/hotnow/baidu/origin.d.ts
vendored
Normal file
10
src/hotnow/baidu/origin.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
isTop: boolean;
|
||||||
|
index?: number;
|
||||||
|
word: string;
|
||||||
|
url: string;
|
||||||
|
newHotName?: string;
|
||||||
|
hotTag?: string;
|
||||||
|
newHotTag?: Record<string, any>;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.errmsg === 'success') {
|
if (responseBody.errmsg === 'success') {
|
||||||
const result: HotListItem[] = responseBody.data.bang_topic.topic_list.map((v) => {
|
const result: HotListItem[] = responseBody.data.bang_topic.topic_list.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.topic_id.toString(),
|
id: v.topic_id.toString(),
|
||||||
title: v.topic_name,
|
title: v.topic_name,
|
||||||
@@ -35,4 +35,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
17
src/hotnow/baidutieba/origin.d.ts
vendored
Normal file
17
src/hotnow/baidutieba/origin.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
topic_id: number;
|
||||||
|
topic_name: string;
|
||||||
|
topic_desc: string;
|
||||||
|
topic_pic: string;
|
||||||
|
discuss_num: number;
|
||||||
|
topic_url: string;
|
||||||
|
abstract?: string;
|
||||||
|
tag?: number;
|
||||||
|
idx_num?: number;
|
||||||
|
create_time?: number;
|
||||||
|
content_num?: number;
|
||||||
|
topic_avatar?: string;
|
||||||
|
is_video_topic?: string;
|
||||||
|
topic_default_avatar?: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -22,6 +22,10 @@
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
|
|
||||||
## 响应示例
|
## 响应示例
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const result: HotListItem[] = data.map((v) => {
|
const result: HotListItem[] = data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.bvid,
|
id: v.bvid,
|
||||||
title: v.title,
|
title: v.title,
|
||||||
@@ -42,4 +42,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
50
src/hotnow/bilibili/origin.d.ts
vendored
Normal file
50
src/hotnow/bilibili/origin.d.ts
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
aid: number;
|
||||||
|
videos: number;
|
||||||
|
tid: number;
|
||||||
|
tname: string;
|
||||||
|
copyright: number;
|
||||||
|
pic: string;
|
||||||
|
title: string;
|
||||||
|
pubdate: number;
|
||||||
|
ctime: number;
|
||||||
|
desc: string;
|
||||||
|
state: number;
|
||||||
|
duration: number;
|
||||||
|
mission_id?: number;
|
||||||
|
rights: Record<string, any>;
|
||||||
|
owner: {
|
||||||
|
mid: number;
|
||||||
|
name: string;
|
||||||
|
face: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
stat: {
|
||||||
|
view: number;
|
||||||
|
danmaku: number;
|
||||||
|
reply: number;
|
||||||
|
favorite: number;
|
||||||
|
coin: number;
|
||||||
|
share: number;
|
||||||
|
now_rank: number;
|
||||||
|
his_rank: number;
|
||||||
|
like: number;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
dynamic: string;
|
||||||
|
cid: number;
|
||||||
|
dimension: {
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
rotate: number;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
short_link_v2: string;
|
||||||
|
first_frame?: string;
|
||||||
|
pub_location?: string;
|
||||||
|
cover43?: string;
|
||||||
|
bvid: string;
|
||||||
|
score?: number;
|
||||||
|
enable_vt?: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -21,7 +21,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.code === 200) {
|
if (responseBody.code === 200) {
|
||||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.articleDetailUrl,
|
id: v.articleDetailUrl,
|
||||||
title: v.articleTitle,
|
title: v.articleTitle,
|
||||||
@@ -39,4 +39,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
22
src/hotnow/csdn/origin.d.ts
vendored
Normal file
22
src/hotnow/csdn/origin.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
period: string;
|
||||||
|
hotRankScore: string;
|
||||||
|
pcHotRankScore: string;
|
||||||
|
loginUserIsFollow: boolean;
|
||||||
|
nickName: string;
|
||||||
|
avatarUrl: string;
|
||||||
|
userName: string;
|
||||||
|
articleTitle: string;
|
||||||
|
articleDetailUrl: string;
|
||||||
|
commentCount: string;
|
||||||
|
favorCount: string;
|
||||||
|
viewCount: string;
|
||||||
|
hotComment: string | null;
|
||||||
|
picList: string[];
|
||||||
|
isNew: string | null;
|
||||||
|
productId: string;
|
||||||
|
productType: string;
|
||||||
|
recommendType: string;
|
||||||
|
report_data: string | null;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -3,7 +3,7 @@ import { HotListItem } from "../type";
|
|||||||
|
|
||||||
export const label = {
|
export const label = {
|
||||||
name: '懂车帝-热搜榜',
|
name: '懂车帝-热搜榜',
|
||||||
icon: 'https://www.dongchedi.com/favicon.ico',
|
icon: 'https://p6-dcd.byteimg.com/img/tos-cn-i-dcdx/4fbb15493036489f950935fa4d86dd8e~tplv-dcdx-default:0:0.png',
|
||||||
color: '#2B5D8A',
|
color: '#2B5D8A',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
9
src/hotnow/dongchedi/origin.d.ts
vendored
Normal file
9
src/hotnow/dongchedi/origin.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
gid: string;
|
||||||
|
title: string;
|
||||||
|
is_hot: number;
|
||||||
|
score: number;
|
||||||
|
description: string;
|
||||||
|
serial_icon: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -47,4 +47,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
1
src/hotnow/douban-movic/origin.d.ts
vendored
Normal file
1
src/hotnow/douban-movic/origin.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export type OriginData = string;
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.status_code === 0) {
|
if (responseBody.status_code === 0) {
|
||||||
const result: HotListItem[] = responseBody.data.word_list.map((v) => {
|
const result: HotListItem[] = responseBody.data.word_list.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.group_id,
|
id: v.group_id,
|
||||||
title: v.word,
|
title: v.word,
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
26
src/hotnow/douyin/origin.d.ts
vendored
Normal file
26
src/hotnow/douyin/origin.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
group_id: string;
|
||||||
|
word: string;
|
||||||
|
word_cover: {
|
||||||
|
url_list: string[];
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
hot_value: string;
|
||||||
|
sentence_id: string;
|
||||||
|
label?: number;
|
||||||
|
position?: number;
|
||||||
|
word_type?: number;
|
||||||
|
sentence_tag?: number;
|
||||||
|
can_extend_detail?: boolean;
|
||||||
|
discuss_video_count?: number;
|
||||||
|
article_detail_count?: number;
|
||||||
|
video_count?: number;
|
||||||
|
room_count?: number;
|
||||||
|
drift_info?: Record<string, any> | null;
|
||||||
|
event_time?: number;
|
||||||
|
hotlist_param?: string;
|
||||||
|
related_words?: Record<string, any> | null;
|
||||||
|
word_sub_board?: Record<string, any> | null;
|
||||||
|
aweme_infos?: Record<string, any> | null;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -59,4 +59,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
1
src/hotnow/github-trending/origin.d.ts
vendored
Normal file
1
src/hotnow/github-trending/origin.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export type OriginData = string;
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -21,7 +21,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.success) {
|
if (responseBody.success) {
|
||||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.item_id,
|
id: v.item_id,
|
||||||
title: `${v.name}-${v.title}`,
|
title: `${v.name}-${v.title}`,
|
||||||
@@ -40,4 +40,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
9
src/hotnow/hello-github/origin.d.ts
vendored
Normal file
9
src/hotnow/hello-github/origin.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
item_id: number;
|
||||||
|
name: string;
|
||||||
|
title: string;
|
||||||
|
summary: string;
|
||||||
|
clicks_total: number;
|
||||||
|
full_name: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // 详情链接
|
url: string; // 详情链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -32,4 +32,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
6
src/hotnow/history-today/origin.d.ts
vendored
Normal file
6
src/hotnow/history-today/origin.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
year: string;
|
||||||
|
title: string;
|
||||||
|
link: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -20,7 +20,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
const data = JSON.parse(json.text().split("window.$$data=")[1])
|
const data = JSON.parse(json.text().split("window.$$data=")[1])
|
||||||
.pageData
|
.pageData
|
||||||
.threads;
|
.threads;
|
||||||
const result: HotListItem[] = data.map((v) => {
|
const result: HotListItem[] = data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.tid,
|
id: v.tid,
|
||||||
title: v.title,
|
title: v.title,
|
||||||
@@ -38,4 +38,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
9
src/hotnow/hupu/origin.d.ts
vendored
Normal file
9
src/hotnow/hupu/origin.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
tid: number;
|
||||||
|
title: string;
|
||||||
|
desc: string;
|
||||||
|
cover: string;
|
||||||
|
lights: number;
|
||||||
|
url: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -20,7 +20,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.success) {
|
if (responseBody.success) {
|
||||||
const result: HotListItem[] = responseBody?.data?.moment_list?.datalist.map((v) => {
|
const result: HotListItem[] = responseBody?.data?.moment_list?.datalist.map((v: any) => {
|
||||||
const content = (v.content || "").replace(/<br\s*\/?>/gi, "\n");
|
const content = (v.content || "").replace(/<br\s*\/?>/gi, "\n");
|
||||||
const [titleLine, ...rest] = content
|
const [titleLine, ...rest] = content
|
||||||
.split("\n")
|
.split("\n")
|
||||||
@@ -47,4 +47,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
6
src/hotnow/huxiu/origin.d.ts
vendored
Normal file
6
src/hotnow/huxiu/origin.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
object_id: string;
|
||||||
|
content: string;
|
||||||
|
format_time: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -16,4 +16,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -18,7 +18,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const result: HotListItem[] = data.map((v) => {
|
const result: HotListItem[] = data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.post_id,
|
id: v.post_id,
|
||||||
title: v.post_title,
|
title: v.post_title,
|
||||||
@@ -33,4 +33,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
6
src/hotnow/ifanr/origin.d.ts
vendored
Normal file
6
src/hotnow/ifanr/origin.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
post_id: number;
|
||||||
|
post_title: string;
|
||||||
|
buzz_original_url: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -45,4 +45,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
1
src/hotnow/ithome/origin.d.ts
vendored
Normal file
1
src/hotnow/ithome/origin.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export type OriginData = string;
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.err_msg === 'success') {
|
if (responseBody.err_msg === 'success') {
|
||||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.content.content_id,
|
id: v.content.content_id,
|
||||||
title: v.content.title,
|
title: v.content.title,
|
||||||
@@ -33,4 +33,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
12
src/hotnow/juejin/origin.d.ts
vendored
Normal file
12
src/hotnow/juejin/origin.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
content: {
|
||||||
|
content_id: string;
|
||||||
|
title: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
content_counter: {
|
||||||
|
hot_rank: number;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -39,4 +39,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
7
src/hotnow/kuaishou/origin.d.ts
vendored
Normal file
7
src/hotnow/kuaishou/origin.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
poster: string;
|
||||||
|
name: string;
|
||||||
|
hotValue: string;
|
||||||
|
id: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.status === 1) {
|
if (responseBody.status === 1) {
|
||||||
const result: HotListItem[] = responseBody.data.result.map((v) => {
|
const result: HotListItem[] = responseBody.data.result.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.iDocID,
|
id: v.iDocID,
|
||||||
title: v.sTitle,
|
title: v.sTitle,
|
||||||
@@ -35,4 +35,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
8
src/hotnow/lol/origin.d.ts
vendored
Normal file
8
src/hotnow/lol/origin.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
iDocID: string;
|
||||||
|
sTitle: string;
|
||||||
|
sAuthor: string;
|
||||||
|
sIMG: string;
|
||||||
|
iTotalPlay: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -28,7 +28,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.code === 200) {
|
if (responseBody.code === 200) {
|
||||||
const result: HotListItem[] = responseBody.result.tracks.map((v) => {
|
const result: HotListItem[] = responseBody.result.tracks.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.id,
|
id: v.id,
|
||||||
title: v.name,
|
title: v.name,
|
||||||
@@ -47,4 +47,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
10
src/hotnow/netease-music/origin.d.ts
vendored
Normal file
10
src/hotnow/netease-music/origin.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
duration: number;
|
||||||
|
album: {
|
||||||
|
picUrl: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.msg === 'success') {
|
if (responseBody.msg === 'success') {
|
||||||
const result: HotListItem[] = responseBody.data.list.map((v) => {
|
const result: HotListItem[] = responseBody.data.list.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.skipID,
|
id: v.skipID,
|
||||||
title: v.title,
|
title: v.title,
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
8
src/hotnow/netease/origin.d.ts
vendored
Normal file
8
src/hotnow/netease/origin.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
skipID: string;
|
||||||
|
title: string;
|
||||||
|
_keyword?: string;
|
||||||
|
imgsrc: string;
|
||||||
|
url: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.ret === 0) {
|
if (responseBody.ret === 0) {
|
||||||
const result: HotListItem[] = responseBody.idlist[0].newslist.slice(1).map((v) => {
|
const result: HotListItem[] = responseBody.idlist[0].newslist.slice(1).map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.id,
|
id: v.id,
|
||||||
title: v.title,
|
title: v.title,
|
||||||
@@ -35,4 +35,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
8
src/hotnow/qq/origin.d.ts
vendored
Normal file
8
src/hotnow/qq/origin.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
abstract: string;
|
||||||
|
miniProShareImage: string;
|
||||||
|
readCount: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -16,7 +16,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.status === 0) {
|
if (responseBody.status === 0) {
|
||||||
const result: HotListItem[] = responseBody.data.articles.map((v) => {
|
const result: HotListItem[] = responseBody.data.articles.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.id,
|
id: v.id,
|
||||||
title: v.title,
|
title: v.title,
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
6
src/hotnow/quark/origin.d.ts
vendored
Normal file
6
src/hotnow/quark/origin.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
publish_time: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.resultCode === 1) {
|
if (responseBody.resultCode === 1) {
|
||||||
const result: HotListItem[] = responseBody.data.hotNews.map((v) => {
|
const result: HotListItem[] = responseBody.data.hotNews.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.contId,
|
id: v.contId,
|
||||||
title: v.name,
|
title: v.name,
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
7
src/hotnow/thepaper/origin.d.ts
vendored
Normal file
7
src/hotnow/thepaper/origin.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
contId: number;
|
||||||
|
name: string;
|
||||||
|
pic: string;
|
||||||
|
praiseTimes: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.status === 'success') {
|
if (responseBody.status === 'success') {
|
||||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.ClusterId,
|
id: v.ClusterId,
|
||||||
title: v.Title,
|
title: v.Title,
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
11
src/hotnow/toutiao/origin.d.ts
vendored
Normal file
11
src/hotnow/toutiao/origin.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
ClusterId: number;
|
||||||
|
ClusterIdStr?: string;
|
||||||
|
Title: string;
|
||||||
|
Image: {
|
||||||
|
url: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
HotValue: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -22,6 +22,10 @@
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
|
|
||||||
## 响应示例
|
## 响应示例
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.ok === 1) {
|
if (responseBody.ok === 1) {
|
||||||
const result: HotListItem[] = responseBody.data.realtime.map((v) => {
|
const result: HotListItem[] = responseBody.data.realtime.map((v: any) => {
|
||||||
const key = v.word_scheme ? v.word_scheme : `#${v.word}`;
|
const key = v.word_scheme ? v.word_scheme : `#${v.word}`;
|
||||||
return {
|
return {
|
||||||
id: v.mid,
|
id: v.mid,
|
||||||
@@ -43,4 +43,6 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
}
|
||||||
|
|||||||
8
src/hotnow/weibo/origin.d.ts
vendored
Normal file
8
src/hotnow/weibo/origin.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
mid: string;
|
||||||
|
word: string;
|
||||||
|
word_scheme: string;
|
||||||
|
num: number;
|
||||||
|
label_name: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -18,4 +18,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -58,7 +58,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.books) {
|
if (responseBody.books) {
|
||||||
const result: HotListItem[] = responseBody.books.map((v) => {
|
const result: HotListItem[] = responseBody.books.map((v: any) => {
|
||||||
const info = v.bookInfo;
|
const info = v.bookInfo;
|
||||||
return {
|
return {
|
||||||
id: info.bookId,
|
id: info.bookId,
|
||||||
@@ -78,4 +78,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
10
src/hotnow/weread/origin.d.ts
vendored
Normal file
10
src/hotnow/weread/origin.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
bookInfo: {
|
||||||
|
bookId: string;
|
||||||
|
title: string;
|
||||||
|
cover: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
readingCount: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -19,4 +19,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -21,7 +21,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.CODE === 200) {
|
if (responseBody.CODE === 200) {
|
||||||
const result: HotListItem[] = responseBody.RESULT.map((v) => {
|
const result: HotListItem[] = responseBody.RESULT.map((v: any) => {
|
||||||
const articleUrl = `https://www.woshipm.com/${v.data.type}/${v.data.id}.html`;
|
const articleUrl = `https://www.woshipm.com/${v.data.type}/${v.data.id}.html`;
|
||||||
return {
|
return {
|
||||||
id: v.data.id,
|
id: v.data.id,
|
||||||
@@ -42,4 +42,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
12
src/hotnow/woshipm/origin.d.ts
vendored
Normal file
12
src/hotnow/woshipm/origin.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
data: {
|
||||||
|
id: number;
|
||||||
|
articleTitle: string;
|
||||||
|
articleSummary: string;
|
||||||
|
imageUrl: string;
|
||||||
|
type: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
scores: number;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
|
|
||||||
## 响应示例
|
## 响应示例
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { HotListItem } from "../type";
|
import { HotListItem } from "../type";
|
||||||
|
|
||||||
export const label = {
|
export const label = {
|
||||||
name: '小红书-实时热榜',
|
name: '小红书-实时热榜',
|
||||||
icon: 'https://www.xiaohongshu.com/favicon.ico',
|
icon: 'https://www.xiaohongshu.com/favicon.ico',
|
||||||
color: '#FF0000',
|
color: '#FF0000',
|
||||||
}
|
};
|
||||||
|
|
||||||
export const main = async function(): Promise<HotListItem[]> {
|
export const main = async function(): Promise<HotListItem[]> {
|
||||||
// 官方 url
|
|
||||||
const url = 'https://edith.xiaohongshu.com/api/sns/v1/search/hot_list';
|
const url = 'https://edith.xiaohongshu.com/api/sns/v1/search/hot_list';
|
||||||
const xhsHeaders = {
|
const xhsHeaders = {
|
||||||
'User-Agent':
|
'User-Agent':
|
||||||
@@ -18,19 +19,15 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
'platform=iOS&version=8.7&build=8070515&deviceId=C323D3A5-6A27-4CE6-AA0E-51C9D4C26A24&bundle=com.xingin.discover',
|
'platform=iOS&version=8.7&build=8070515&deviceId=C323D3A5-6A27-4CE6-AA0E-51C9D4C26A24&bundle=com.xingin.discover',
|
||||||
'xy-common-params':
|
'xy-common-params':
|
||||||
'app_id=ECFAAF02&build=8070515&channel=AppStore&deviceId=C323D3A5-6A27-4CE6-AA0E-51C9D4C26A24&device_fingerprint=20230920120211bd7b71a80778509cf4211099ea911000010d2f20f6050264&device_fingerprint1=20230920120211bd7b71a80778509cf4211099ea911000010d2f20f6050264&device_model=phone&fid=1695182528-0-0-63b29d709954a1bb8c8733eb2fb58f29&gid=7dc4f3d168c355f1a886c54a898c6ef21fe7b9a847359afc77fc24ad&identifier_flag=0&lang=zh-Hans&launch_id=716882697&platform=iOS&project_id=ECFAAF&sid=session.1695189743787849952190&t=1695190591&teenager=0&tz=Asia/Shanghai&uis=light&version=8.7',
|
'app_id=ECFAAF02&build=8070515&channel=AppStore&deviceId=C323D3A5-6A27-4CE6-AA0E-51C9D4C26A24&device_fingerprint=20230920120211bd7b71a80778509cf4211099ea911000010d2f20f6050264&device_fingerprint1=20230920120211bd7b71a80778509cf4211099ea911000010d2f20f6050264&device_model=phone&fid=1695182528-0-0-63b29d709954a1bb8c8733eb2fb58f29&gid=7dc4f3d168c355f1a886c54a898c6ef21fe7b9a847359afc77fc24ad&identifier_flag=0&lang=zh-Hans&launch_id=716882697&platform=iOS&project_id=ECFAAF&sid=session.1695189743787849952190&t=1695190591&teenager=0&tz=Asia/Shanghai&uis=light&version=8.7',
|
||||||
}
|
};
|
||||||
try {
|
try {
|
||||||
// 请求数据
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
headers: xhsHeaders,
|
headers: xhsHeaders,
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
// 如果请求失败,抛出错误,不进行缓存
|
|
||||||
throw new Error(`请求错误 ${label.name}`);
|
throw new Error(`请求错误 ${label.name}`);
|
||||||
}
|
}
|
||||||
// 得到请求体
|
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
// 处理数据
|
|
||||||
if (responseBody.success) {
|
if (responseBody.success) {
|
||||||
const result: HotListItem[] = responseBody.data?.items.map((v: any): HotListItem => {
|
const result: HotListItem[] = responseBody.data?.items.map((v: any): HotListItem => {
|
||||||
return {
|
return {
|
||||||
@@ -47,9 +44,10 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
} catch {
|
} catch {
|
||||||
// 请求失败,返回空数据
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
}
|
||||||
7
src/hotnow/xiaohongshu/origin.d.ts
vendored
Normal file
7
src/hotnow/xiaohongshu/origin.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
score: number;
|
||||||
|
word_type?: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -17,4 +17,8 @@
|
|||||||
url: string; // PC 端链接
|
url: string; // PC 端链接
|
||||||
mobileUrl?: string; // 移动端链接
|
mobileUrl?: string; // 移动端链接
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
@@ -25,7 +25,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const result: HotListItem[] = data.map((v) => {
|
const result: HotListItem[] = data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.id,
|
id: v.id,
|
||||||
title: v.title,
|
title: v.title,
|
||||||
@@ -40,4 +40,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
6
src/hotnow/zhihu-daily/origin.d.ts
vendored
Normal file
6
src/hotnow/zhihu-daily/origin.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
id: number;
|
||||||
|
title: string;
|
||||||
|
url: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
@@ -20,6 +20,10 @@
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## OriginData 类型参考
|
||||||
|
|
||||||
|
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||||
|
|
||||||
## 响应示例
|
## 响应示例
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
const responseBody = await response.json();
|
const responseBody = await response.json();
|
||||||
if (responseBody.data) {
|
if (responseBody.data) {
|
||||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||||
return {
|
return {
|
||||||
id: v.id,
|
id: v.id,
|
||||||
title: v.target.title,
|
title: v.target.title,
|
||||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
main().then(console.log).catch(console.error);
|
if (import.meta.main) {
|
||||||
|
main().then(console.log).catch(console.error);
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
14
src/hotnow/zhihu/origin.d.ts
vendored
Normal file
14
src/hotnow/zhihu/origin.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export interface OriginData {
|
||||||
|
id: string;
|
||||||
|
card_id?: string;
|
||||||
|
target: {
|
||||||
|
title: string;
|
||||||
|
[key: string]: any;
|
||||||
|
};
|
||||||
|
children?: {
|
||||||
|
thumbnail: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}[];
|
||||||
|
detail_text?: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user