Auto commit: 2026-03-26 01:03
This commit is contained in:
@@ -25,3 +25,7 @@ export type HotListItem = {
|
||||
## hotnow 模块
|
||||
|
||||
单独的 api 的模块,纯粹负责获取数据,不涉及任何 UI 相关的东西。这样做的好处是可以让数据获取和 UI 展示解耦,方便后续维护和扩展。
|
||||
|
||||
## 其他模块
|
||||
|
||||
使用 bun 运行
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
if (responseBody.code === 0) {
|
||||
const result: HotListItem[] = responseBody.data?.hotRankList.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data?.hotRankList.map((v: any) => {
|
||||
return {
|
||||
id: v.itemId,
|
||||
title: v?.templateMaterial?.widgetTitle,
|
||||
@@ -48,4 +48,6 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -18,3 +18,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -15,9 +15,9 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
const responseBody = await response.json();
|
||||
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 {
|
||||
id: v.index,
|
||||
id: v.index ?? v.isTop ? idx + 1 : v.index,
|
||||
title: v.word,
|
||||
label: v.newHotName,
|
||||
url: `https://www.baidu.com/s?wd=${encodeURIComponent(v.word)}`,
|
||||
@@ -33,4 +33,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
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 {
|
||||
id: v.topic_id.toString(),
|
||||
title: v.topic_name,
|
||||
@@ -35,4 +35,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -24,7 +24,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
if (!data) {
|
||||
return [];
|
||||
}
|
||||
const result: HotListItem[] = data.map((v) => {
|
||||
const result: HotListItem[] = data.map((v: any) => {
|
||||
return {
|
||||
id: v.bvid,
|
||||
title: v.title,
|
||||
@@ -42,4 +42,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -18,3 +18,7 @@
|
||||
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();
|
||||
if (responseBody.code === 200) {
|
||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||
return {
|
||||
id: v.articleDetailUrl,
|
||||
title: v.articleTitle,
|
||||
@@ -39,4 +39,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -18,3 +18,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -3,7 +3,7 @@ import { HotListItem } from "../type";
|
||||
|
||||
export const label = {
|
||||
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',
|
||||
};
|
||||
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -47,4 +47,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -19,3 +19,7 @@
|
||||
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();
|
||||
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 {
|
||||
id: v.group_id,
|
||||
title: v.word,
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -59,4 +59,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -19,3 +19,7 @@
|
||||
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();
|
||||
if (responseBody.success) {
|
||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||
return {
|
||||
id: v.item_id,
|
||||
title: `${v.name}-${v.title}`,
|
||||
@@ -40,4 +40,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -32,4 +32,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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])
|
||||
.pageData
|
||||
.threads;
|
||||
const result: HotListItem[] = data.map((v) => {
|
||||
const result: HotListItem[] = data.map((v: any) => {
|
||||
return {
|
||||
id: v.tid,
|
||||
title: v.title,
|
||||
@@ -38,4 +38,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
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 [titleLine, ...rest] = content
|
||||
.split("\n")
|
||||
@@ -47,4 +47,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -17,3 +17,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -18,7 +18,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
if (!data) {
|
||||
return [];
|
||||
}
|
||||
const result: HotListItem[] = data.map((v) => {
|
||||
const result: HotListItem[] = data.map((v: any) => {
|
||||
return {
|
||||
id: v.post_id,
|
||||
title: v.post_title,
|
||||
@@ -33,4 +33,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -45,4 +45,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
@@ -18,3 +18,7 @@
|
||||
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();
|
||||
if (responseBody.err_msg === 'success') {
|
||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||
return {
|
||||
id: v.content.content_id,
|
||||
title: v.content.title,
|
||||
@@ -33,4 +33,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -18,3 +18,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -39,4 +39,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
if (responseBody.status === 1) {
|
||||
const result: HotListItem[] = responseBody.data.result.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.result.map((v: any) => {
|
||||
return {
|
||||
id: v.iDocID,
|
||||
title: v.sTitle,
|
||||
@@ -35,4 +35,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
if (responseBody.code === 200) {
|
||||
const result: HotListItem[] = responseBody.result.tracks.map((v) => {
|
||||
const result: HotListItem[] = responseBody.result.tracks.map((v: any) => {
|
||||
return {
|
||||
id: v.id,
|
||||
title: v.name,
|
||||
@@ -47,4 +47,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
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();
|
||||
if (responseBody.msg === 'success') {
|
||||
const result: HotListItem[] = responseBody.data.list.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.list.map((v: any) => {
|
||||
return {
|
||||
id: v.skipID,
|
||||
title: v.title,
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
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 {
|
||||
id: v.id,
|
||||
title: v.title,
|
||||
@@ -35,4 +35,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -18,3 +18,7 @@
|
||||
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();
|
||||
if (responseBody.status === 0) {
|
||||
const result: HotListItem[] = responseBody.data.articles.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.articles.map((v: any) => {
|
||||
return {
|
||||
id: v.id,
|
||||
title: v.title,
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
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();
|
||||
if (responseBody.resultCode === 1) {
|
||||
const result: HotListItem[] = responseBody.data.hotNews.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.hotNews.map((v: any) => {
|
||||
return {
|
||||
id: v.contId,
|
||||
title: v.name,
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
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();
|
||||
if (responseBody.status === 'success') {
|
||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||
return {
|
||||
id: v.ClusterId,
|
||||
title: v.Title,
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -22,7 +22,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
const responseBody = await response.json();
|
||||
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}`;
|
||||
return {
|
||||
id: v.mid,
|
||||
@@ -43,4 +43,6 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -19,3 +19,7 @@
|
||||
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();
|
||||
if (responseBody.books) {
|
||||
const result: HotListItem[] = responseBody.books.map((v) => {
|
||||
const result: HotListItem[] = responseBody.books.map((v: any) => {
|
||||
const info = v.bookInfo;
|
||||
return {
|
||||
id: info.bookId,
|
||||
@@ -78,4 +78,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -20,3 +20,7 @@
|
||||
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();
|
||||
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`;
|
||||
return {
|
||||
id: v.data.id,
|
||||
@@ -42,4 +42,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { HotListItem } from "../type";
|
||||
|
||||
export const label = {
|
||||
name: '小红书-实时热榜',
|
||||
icon: 'https://www.xiaohongshu.com/favicon.ico',
|
||||
color: '#FF0000',
|
||||
}
|
||||
};
|
||||
|
||||
export const main = async function(): Promise<HotListItem[]> {
|
||||
// 官方 url
|
||||
const url = 'https://edith.xiaohongshu.com/api/sns/v1/search/hot_list';
|
||||
const xhsHeaders = {
|
||||
'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',
|
||||
'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',
|
||||
}
|
||||
};
|
||||
try {
|
||||
// 请求数据
|
||||
const response = await fetch(url, {
|
||||
headers: xhsHeaders,
|
||||
});
|
||||
if (!response.ok) {
|
||||
// 如果请求失败,抛出错误,不进行缓存
|
||||
throw new Error(`请求错误 ${label.name}`);
|
||||
}
|
||||
// 得到请求体
|
||||
const responseBody = await response.json();
|
||||
// 处理数据
|
||||
if (responseBody.success) {
|
||||
const result: HotListItem[] = responseBody.data?.items.map((v: any): HotListItem => {
|
||||
return {
|
||||
@@ -47,9 +44,10 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
return [];
|
||||
} catch {
|
||||
// 请求失败,返回空数据
|
||||
return [];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -18,3 +18,7 @@
|
||||
mobileUrl?: string; // 移动端链接
|
||||
}
|
||||
```
|
||||
|
||||
## OriginData 类型参考
|
||||
|
||||
类型定义文件:[origin.d.ts](./origin.d.ts)
|
||||
@@ -25,7 +25,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
if (!data) {
|
||||
return [];
|
||||
}
|
||||
const result: HotListItem[] = data.map((v) => {
|
||||
const result: HotListItem[] = data.map((v: any) => {
|
||||
return {
|
||||
id: v.id,
|
||||
title: v.title,
|
||||
@@ -40,4 +40,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
@@ -15,7 +15,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
const responseBody = await response.json();
|
||||
if (responseBody.data) {
|
||||
const result: HotListItem[] = responseBody.data.map((v) => {
|
||||
const result: HotListItem[] = responseBody.data.map((v: any) => {
|
||||
return {
|
||||
id: v.id,
|
||||
title: v.target.title,
|
||||
@@ -34,4 +34,7 @@ export const main = async function(): Promise<HotListItem[]> {
|
||||
}
|
||||
};
|
||||
|
||||
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