forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add wainao * wainao-reads * Update lib/routes/wainao/wainao-reads.ts Change category Co-authored-by: Tony <[email protected]> * Update lib/routes/wainao/wainao-reads.ts Remove url https Co-authored-by: Tony <[email protected]> * Update lib/routes/wainao/wainao-reads.ts Remove url http Co-authored-by: Tony <[email protected]> * cleanup ---------
- Loading branch information
1 parent
0a5792b
commit a73b28b
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { Namespace } from '@/types'; | ||
|
||
export const namespace: Namespace = { | ||
name: '歪脑', | ||
url: 'wainao.me', | ||
description: '歪脑是为讲中文的年轻一代度身定制的新闻杂志。', | ||
lang: 'zh-CN', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Route } from '@/types'; | ||
import got from '@/utils/got'; | ||
import { parseDate } from '@/utils/parse-date'; | ||
|
||
export const route: Route = { | ||
path: '/wainao-reads', | ||
categories: ['new-media'], | ||
example: '/wainao/wainao-reads', | ||
features: { | ||
requireConfig: false, | ||
requirePuppeteer: false, | ||
antiCrawler: false, | ||
supportBT: false, | ||
supportPodcast: false, | ||
supportScihub: false, | ||
}, | ||
url: 'www.wainao.me', | ||
name: '歪脑读', | ||
maintainers: ['lucky13820'], | ||
radar: [ | ||
{ | ||
source: ['www.wainao.me', 'www.wainao.me/wainao-reads'], | ||
target: '/wainao-reads', | ||
}, | ||
], | ||
handler, | ||
}; | ||
|
||
async function handler() { | ||
const apiUrl = 'https://www.wainao.me/pf/api/v3/content/fetch/content-api-collections?query={"content_alias":"wainao-hero"}&d=81&_website=wainao'; | ||
const baseUrl = 'https://www.wainao.me'; | ||
|
||
const response = await got(apiUrl); | ||
const data = JSON.parse(response.body); | ||
|
||
const items = data.content_elements.map((item) => ({ | ||
title: item.headlines.basic, | ||
description: item.description?.basic || '', | ||
link: baseUrl + item.canonical_url, | ||
pubDate: parseDate(item.publish_date), | ||
image: item.promo_items?.basic?.url || '', | ||
})); | ||
|
||
return { | ||
title: '歪脑读 - 歪脑', | ||
link: baseUrl, | ||
item: items, | ||
}; | ||
} |