mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
+11
-2
@@ -205,6 +205,16 @@ For instance, the `/github/topics/framework/l=php&o=desc&s=stars` route will gen
|
||||
|
||||
<RouteEn author="zoenglinghou" example="/gitlab/tag/rluna-open-source%2Ffile-management%2Fowncloud/core/gitlab.com" path="/gitlab/tag/:namespace/:project/:host?" :paramsDesc="['owner or namespace. `/` needs to be replaced with `%2F`', 'project name', 'Gitlab instance hostname, default to gitlab.com']" />
|
||||
|
||||
## Gitpod
|
||||
|
||||
### Blog
|
||||
|
||||
<RouteEn author="TonyRL" example="/gitpod/blog" path="/gitpod/blog" />
|
||||
|
||||
### Changelog
|
||||
|
||||
<RouteEn author="TonyRL" example="/gitpod/changelog" path="/gitpod/changelog" />
|
||||
|
||||
## Hacker News
|
||||
|
||||
### Section
|
||||
@@ -237,8 +247,7 @@ Subscribe to the updates (threads and submission) from a paritcular Hacker News
|
||||
|
||||
### Hex-Rays News
|
||||
|
||||
<RouteEn author="hellodword" example="/hex-rays/news" path="/hex-rays/news">
|
||||
</RouteEn>
|
||||
<RouteEn author="hellodword" example="/hex-rays/news" path="/hex-rays/news" />
|
||||
|
||||
## Kaggle
|
||||
|
||||
|
||||
+11
-2
@@ -283,6 +283,16 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
<Route author="zoenglinghou" example="/gitlab/tag/rluna-open-source%2Ffile-management%2Fowncloud/core/gitlab.com" path="/gitlab/tag/:namespace/:project/:host?" :paramsDesc="['项目所有者或命名空间。斜杠`/`需要替代为`%2F`', '项目名称', '服务器地址,缺省为 gitlab.com']" />
|
||||
|
||||
## Gitpod
|
||||
|
||||
### 博客
|
||||
|
||||
<Route author="TonyRL" example="/gitpod/blog" path="/gitpod/blog" />
|
||||
|
||||
### 更新日志
|
||||
|
||||
<Route author="TonyRL" example="/gitpod/changelog" path="/gitpod/changelog" />
|
||||
|
||||
## Go 语言中文网
|
||||
|
||||
### 周刊
|
||||
@@ -803,8 +813,7 @@ GitHub 官方也提供了一些 RSS:
|
||||
|
||||
### 开源项目
|
||||
|
||||
<Route author="mlogclub" example="/mlog-club/projects" path="/mlog-club/projects">
|
||||
</Route>
|
||||
<Route author="mlogclub" example="/mlog-club/projects" path="/mlog-club/projects" />
|
||||
|
||||
## 码农网
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const { rootUrl } = require('./utils');
|
||||
const { art } = require('@/utils/render');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 10;
|
||||
const response = await got(rootUrl + '/blog');
|
||||
const $ = cheerio.load(response.data);
|
||||
let items = $('div[class^="flex justify-center"]')
|
||||
.slice(0, limit)
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('h2').text(),
|
||||
link: rootUrl + item.find('a').attr('href'),
|
||||
pubDate: parseDate(item.find('span[class^=date]').text()),
|
||||
};
|
||||
});
|
||||
|
||||
items = await Promise.all(
|
||||
items.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got(item.link);
|
||||
const content = cheerio.load(detailResponse.data);
|
||||
|
||||
const headerImg = content('img[class^=max-h]');
|
||||
item.description = art(path.join(__dirname, 'templates/description.art'), {
|
||||
img: headerImg.attr('src'),
|
||||
alt: headerImg.attr('alt'),
|
||||
content: content('div[class^=content-blog]').html(),
|
||||
});
|
||||
item.author = content('span.avatars a')
|
||||
.toArray()
|
||||
.map((e) => content(e).text().trim())
|
||||
.join(', ');
|
||||
return item;
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
link: rootUrl + '/blog',
|
||||
description: $('meta[name="description"]').attr('content'),
|
||||
language: 'en-US',
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const { rootUrl } = require('./utils');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got(rootUrl + '/changelog');
|
||||
const $ = cheerio.load(response.data);
|
||||
const items = $('div[class^=changelog-entry]')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('h2').text(),
|
||||
link: rootUrl + item.find('a').attr('href'),
|
||||
description: item.find('div[class^=content-docs]').html(),
|
||||
pubDate: parseDate(item.find('a[class*=mb-xx-small]').text()),
|
||||
author: item
|
||||
.find('span[class^=flex-shrink-0]')
|
||||
.eq(0)
|
||||
.find('img')
|
||||
.toArray()
|
||||
.map((e) => $(e).attr('alt').replace('Avatar of ', ''))
|
||||
.join(', '),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
link: rootUrl + '/changelog',
|
||||
description: $('meta[name="description"]').attr('content'),
|
||||
language: 'en-US',
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
'/blog': ['TonyRL'],
|
||||
'/changelog': ['TonyRL'],
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
module.exports = {
|
||||
'gitpod.io': {
|
||||
_name: 'Gitpod',
|
||||
'.': [
|
||||
{
|
||||
title: '博客',
|
||||
docs: 'https://docs.rsshub.app/programming.html#gitpod',
|
||||
source: ['/blog', '/'],
|
||||
target: '/gitpod/blog',
|
||||
},
|
||||
{
|
||||
title: '更新日志',
|
||||
docs: 'https://docs.rsshub.app/programming.html#gitpod',
|
||||
source: ['/changelog', '/'],
|
||||
target: '/gitpod/changelog',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
module.exports = (router) => {
|
||||
router.get('/blog', require('./blog'));
|
||||
router.get('/changelog', require('./changelog'));
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
<img src="{{ img }}" alt="{{ alt }}">
|
||||
{{@ content }}
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
rootUrl: 'https://www.gitpod.io',
|
||||
};
|
||||
Reference in New Issue
Block a user