feat: add source 少数派 & 稀土掘金 (#127)
resolve #42, resolve #118, resolve #48
This commit is contained in:
Vendored
+2
@@ -15,6 +15,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' {
|
||||
export const hackernews: typeof import('./sources/hackernews')
|
||||
export const ithome: typeof import('./sources/ithome')
|
||||
export const jin10: typeof import('./sources/jin10')
|
||||
export const juejin: typeof import('./sources/juejin')
|
||||
export const kaopu: typeof import('./sources/kaopu')
|
||||
export const kuaishou: typeof import('./sources/kuaishou')
|
||||
export const linuxdo: typeof import('./sources/linuxdo')
|
||||
@@ -24,6 +25,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' {
|
||||
export const smzdm: typeof import('./sources/smzdm')
|
||||
export const solidot: typeof import('./sources/solidot')
|
||||
export const sputniknewscn: typeof import('./sources/sputniknewscn')
|
||||
export const sspai: typeof import('./sources/sspai')
|
||||
export const thepaper: typeof import('./sources/thepaper')
|
||||
export const tieba: typeof import('./sources/tieba')
|
||||
export const toutiao: typeof import('./sources/toutiao')
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
interface Res {
|
||||
data: {
|
||||
content: {
|
||||
title: string
|
||||
content_id: string
|
||||
}
|
||||
}[]
|
||||
}
|
||||
|
||||
export default defineSource(async () => {
|
||||
const url = `https://api.juejin.cn/content_api/v1/content/article_rank?category_id=1&type=hot&spider=0`
|
||||
const res: Res = await myFetch(url)
|
||||
return res.data.map((k) => {
|
||||
const url = `https://juejin.cn/post/${k.content.content_id}`
|
||||
return {
|
||||
id: k.content.content_id,
|
||||
title: k.content.title,
|
||||
url,
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5,8 +5,7 @@ interface Res {
|
||||
title: string
|
||||
type: number
|
||||
uuid: string
|
||||
hotValueFromDolphin: number
|
||||
}
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
interface Res {
|
||||
data: {
|
||||
id: number
|
||||
title: string
|
||||
}[]
|
||||
}
|
||||
|
||||
export default defineSource(async () => {
|
||||
const timestamp = Date.now()
|
||||
const limit = 30
|
||||
const url = `https://sspai.com/api/v1/article/tag/page/get?limit=${limit}&offset=0&created_at=${timestamp}&tag=%E7%83%AD%E9%97%A8%E6%96%87%E7%AB%A0&released=false`
|
||||
const res: Res = await myFetch(url)
|
||||
return res.data.map((k) => {
|
||||
const url = `https://sspai.com/post/${k.id}`
|
||||
return {
|
||||
id: k.id,
|
||||
title: k.title,
|
||||
url,
|
||||
}
|
||||
})
|
||||
})
|
||||
+3
-1
@@ -39,5 +39,7 @@
|
||||
"linuxdo-hot": "LINUX DO-jinrizuire",
|
||||
"ghxi": "guoheboke",
|
||||
"smzdm": "shenmezhidemai",
|
||||
"nowcoder": "niuke"
|
||||
"nowcoder": "niuke",
|
||||
"sspai": "shaoshupai",
|
||||
"juejin": "xitujuejin"
|
||||
}
|
||||
@@ -357,6 +357,20 @@ export const originSources = {
|
||||
type: "hottest",
|
||||
home: "https://www.nowcoder.com",
|
||||
},
|
||||
"sspai": {
|
||||
name: "少数派",
|
||||
column: "china",
|
||||
color: "red",
|
||||
type: "hottest",
|
||||
home: "https://sspai.com",
|
||||
},
|
||||
"juejin": {
|
||||
name: "稀土掘金",
|
||||
column: "china",
|
||||
color: "blue",
|
||||
type: "hottest",
|
||||
home: "https://juejin.cn",
|
||||
},
|
||||
} as const satisfies Record<string, OriginSource>
|
||||
|
||||
export function genSources() {
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
"bilibili-hot-video": {
|
||||
"name": "哔哩哔哩",
|
||||
"type": "hottest",
|
||||
"disable": "cf",
|
||||
"column": "china",
|
||||
"home": "https://www.bilibili.com",
|
||||
"color": "blue",
|
||||
@@ -357,6 +358,7 @@
|
||||
"bilibili-ranking": {
|
||||
"name": "哔哩哔哩",
|
||||
"type": "hottest",
|
||||
"disable": "cf",
|
||||
"column": "china",
|
||||
"home": "https://www.bilibili.com",
|
||||
"color": "blue",
|
||||
@@ -448,5 +450,21 @@
|
||||
"home": "https://www.nowcoder.com",
|
||||
"color": "blue",
|
||||
"interval": 600000
|
||||
},
|
||||
"sspai": {
|
||||
"name": "少数派",
|
||||
"type": "hottest",
|
||||
"column": "china",
|
||||
"home": "https://sspai.com",
|
||||
"color": "red",
|
||||
"interval": 600000
|
||||
},
|
||||
"juejin": {
|
||||
"name": "稀土掘金",
|
||||
"type": "hottest",
|
||||
"column": "china",
|
||||
"home": "https://juejin.cn",
|
||||
"color": "blue",
|
||||
"interval": 600000
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user