Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kongnet/daily-rss
rss develop
https://github.com/kongnet/daily-rss
blog nodejs rss today
Last synced: about 1 month ago
JSON representation
rss develop
- Host: GitHub
- URL: https://github.com/kongnet/daily-rss
- Owner: kongnet
- License: mit
- Created: 2023-01-16T07:44:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T10:24:36.000Z (11 months ago)
- Last Synced: 2024-04-13T19:21:46.483Z (8 months ago)
- Topics: blog, nodejs, rss, today
- Language: HTML
- Homepage:
- Size: 2.04 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Daily-RSS
### Introduction 简介
> 简易每日聚合 RSS 生成页面框架
> Simple Daily Aggregation RSS Generated Page Framework
> 跨服务器支持,全静态页面
> Cross-server support, fully static pages### Read Online 现在阅读
https://daily.skykong.xyz
### Version Dependency 版本依赖
nodejs version: >=18.x.x
### Install 安装```
npm install daily-rss
```### Example 用例
```
const rss = require('daily-rss')//modify config
const config = {
'people' : 'http://www.people.com.cn/rss/politics.xml'
}//modify adaptor, return the array of objects (title,link,description)
const adaptor = {
'people': async res => {
const rst = rss.convert.xml2json(await res.text(), {
compact: true,
spaces: 0
})
const items = JSON.parse(rst).rss.channel.item
return items.map(x => {
return { title: x.title._cdata, link: x.link._text, desc: x.description._cdata }
})
}
}async function main() {
rss.setConfig(config,adaptor)
const data = await rss.rss2json()
rss.rss2md(data)
}
```### Step 实现步骤
- 1. set rss url and adaptor 配置rss源和对应的解析函数
- 2. parse RSS data 解析 RSS 数据
- 3. render 渲染(html md)
- 4. crontab 设置定时任务
- 5. website 配置网站显示前端数据
- a. Nginx setting 配置 Nginx
- b. Https setting 配置 Https
- c. or Docker[Get code](https://github.com/kongnet/daily-rss)