diff --git a/docs/programming.md b/docs/programming.md index 7596bdd34..aab95705d 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -814,6 +814,34 @@ GitHub 官方也提供了一些 RSS: +## 登链社区 + +### 文章 + + + +| id | 分类 | +| -------- | ------ | +| all | 全部 | +| DApp | 去中心化应用 | +| chains | 公链 | +| 联盟链 | 联盟链 | +| scaling | Layer2 | +| langs | 编程语言 | +| security | 安全 | +| dst | 存储 | +| basic | 理论研究 | +| other | 其他 | + +| id | 排序方式 | +| -------- | ------- | +| newest | 最新 | +| featured | 精选 (默认) | +| featured | 最赞 | +| hottest | 最热 | + + + ## 饿了么开放平台 ### 商家开放平台公告 @@ -824,35 +852,6 @@ GitHub 官方也提供了一些 RSS: -## 登链社区 - -### 文章 - - - -| id | 分类 | -|----------|--------------| -| all | 全部 | -| DApp | 去中心化应用 | -| chains | 公链 | -| 联盟链 | 联盟链 | -| scaling | Layer2 | -| langs | 编程语言 | -| security | 安全 | -| dst | 存储 | -| basic | 理论研究 | -| other | 其他 | - - -| id | 排序方式 | -|----------|------------| -| newest | 最新 | -| featured | 精选(默认) | -| featured | 最赞 | -| hottest | 最热 | - - - ## 极客时间 ### 专栏文章 diff --git a/lib/v2/learnblockchain/posts.js b/lib/v2/learnblockchain/posts.js index 341b94187..29cef50c8 100644 --- a/lib/v2/learnblockchain/posts.js +++ b/lib/v2/learnblockchain/posts.js @@ -1,8 +1,6 @@ const cheerio = require('cheerio'); const got = require('@/utils/got'); -const { - parseRelativeDate -} = require('@/utils/parse-date'); +const { parseRelativeDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const cid = ctx.params.cid || 'all'; @@ -25,18 +23,21 @@ module.exports = async (ctx) => { title: `登链社区--${cid}`, link: url, description: `登链社区`, - item: list && list.map((idx, ite) => { - const item = $(ite); - const json = { - title: item.find('h2.title').text().trim(), - description: item.find('div.excerpt').text().trim(), - pubDate: parseRelativeDate(item.find('.author li:nth-child(2)').text().replace('发布于', '').trim()), - link: item.find('h2.title a').attr('href').trim(), - author: item.find('.author li:nth-child(1)').text().trim(), - }; + item: + list && + list + .map((idx, ite) => { + const item = $(ite); + const json = { + title: item.find('h2.title').text().trim(), + description: item.find('div.excerpt').text().trim(), + pubDate: parseRelativeDate(item.find('.author li:nth-child(2)').text().replace('发布于', '').trim()), + link: item.find('h2.title a').attr('href').trim(), + author: item.find('.author li:nth-child(1)').text().trim(), + }; - return json; - }).get(), + return json; + }) + .get(), }; - }; diff --git a/lib/v2/learnblockchain/radar.js b/lib/v2/learnblockchain/radar.js index 1e746ca12..aa3a90197 100644 --- a/lib/v2/learnblockchain/radar.js +++ b/lib/v2/learnblockchain/radar.js @@ -1,7 +1,8 @@ module.exports = { 'learnblockchain.cn': { _name: '登链社区', - '.': [{ + '.': [ + { title: '分类文章', docs: 'https://docs.rsshub.app/programming.html#deng-lian-she-qu-wen-zhang', source: '/categories/:cid/:sort?', @@ -12,8 +13,7 @@ module.exports = { docs: 'https://docs.rsshub.app/programming.html#deng-lian-she-qu-wen-zhang', source: '*', target: () => '/learnblockchain/posts/all/', - } - + }, ], }, };