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 nytimes morning post (DIYgod#253)
- Loading branch information
Showing
6 changed files
with
66 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -127,6 +127,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇 | |
- yande.re | ||
- posts | ||
- Popular Recent Posts | ||
- 纽约时报 | ||
- 新闻早报 | ||
|
||
## 鸣谢 | ||
|
||
|
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
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
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
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,25 @@ | ||
const Parser = require('rss-parser'); | ||
const parser = new Parser(); | ||
|
||
module.exports = async (ctx) => { | ||
const feed = await parser.parseURL('https://cn.nytimes.com/rss/'); | ||
const items = []; | ||
feed.items.forEach((item) => { | ||
if (item.title.startsWith('早报:')) { | ||
items.push({ | ||
title: item.title, | ||
description: item.content, | ||
pubDate: item.pubDate, | ||
guid: item.guid, | ||
link: item.link, | ||
}); | ||
} | ||
}); | ||
|
||
ctx.state.data = { | ||
title: '纽约时报 新闻早报', | ||
link: encodeURI('https://cn.nytimes.com/search?query=%E6%97%A9%E6%8A%A5&lang=&dt=json&from=0&size=10'), | ||
description: '纽约时报 新闻早报', | ||
item: items, | ||
}; | ||
}; |
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 |
---|---|---|
|
@@ -6349,6 +6349,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: | |
hash-base "^3.0.0" | ||
inherits "^2.0.1" | ||
|
||
rss-parser@^3.1.3: | ||
version "3.1.3" | ||
resolved "http://registry.npm.taobao.org/rss-parser/download/rss-parser-3.1.3.tgz#ad56491623d66ccce2f4f5c833377542c0f0c4f5" | ||
dependencies: | ||
entities "^1.1.1" | ||
xml2js "^0.4.17" | ||
|
||
run-async@^2.2.0: | ||
version "2.3.0" | ||
resolved "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" | ||
|
@@ -6395,7 +6402,7 @@ [email protected]: | |
version "0.5.8" | ||
resolved "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" | ||
|
||
sax@^1.2.4, sax@~1.2.1: | ||
sax@>=0.6.0, sax@^1.2.4, sax@~1.2.1: | ||
version "1.2.4" | ||
resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" | ||
|
||
|
@@ -7777,6 +7784,17 @@ xml-name-validator@^3.0.0: | |
version "3.0.0" | ||
resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" | ||
|
||
xml2js@^0.4.17: | ||
version "0.4.19" | ||
resolved "http://registry.npm.taobao.org/xml2js/download/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7" | ||
dependencies: | ||
sax ">=0.6.0" | ||
xmlbuilder "~9.0.1" | ||
|
||
xmlbuilder@~9.0.1: | ||
version "9.0.7" | ||
resolved "http://registry.npm.taobao.org/xmlbuilder/download/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" | ||
|
||
xtend@^4.0.0, xtend@~4.0.1: | ||
version "4.0.1" | ||
resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" | ||
|