rsshub 1.0.0-master.d2b1df9 → 1.0.0-master.d2bf7b3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.js +3 -0
- package/lib/middleware/cache/index.js +3 -0
- package/lib/router.js +5 -5
- package/lib/v2/bangumi/maintainer.js +1 -0
- package/lib/v2/bangumi/online.js +26 -0
- package/lib/v2/bangumi/radar.js +13 -2
- package/lib/v2/bangumi/router.js +1 -0
- package/lib/v2/bangumi/templates/image.art +1 -0
- package/lib/v2/bilibili/collection.js +34 -0
- package/lib/v2/bilibili/maintainer.js +1 -0
- package/lib/v2/bilibili/radar.js +9 -0
- package/lib/v2/bilibili/router.js +1 -0
- package/lib/v2/china/maintainer.js +4 -0
- package/lib/v2/china/news/highlights/news.js +40 -0
- package/lib/v2/china/news/military/news.js +31 -0
- package/lib/v2/china/radar.js +21 -0
- package/lib/v2/china/router.js +4 -0
- package/lib/v2/csdn/blog.js +39 -0
- package/lib/v2/csdn/maintainer.js +3 -0
- package/lib/v2/csdn/radar.js +13 -0
- package/lib/v2/csdn/router.js +3 -0
- package/lib/v2/douyu/post.js +9 -2
- package/lib/v2/github/comments.js +3 -4
- package/lib/v2/hupu/bbs.js +23 -23
- package/lib/v2/huxiu/maintainer.js +1 -0
- package/lib/v2/huxiu/moment.js +40 -0
- package/lib/v2/huxiu/radar.js +6 -0
- package/lib/v2/huxiu/router.js +1 -0
- package/lib/v2/huxiu/templates/moment.art +16 -0
- package/lib/v2/iwara/maintainer.js +1 -0
- package/lib/v2/iwara/radar.js +6 -0
- package/lib/v2/iwara/router.js +1 -0
- package/lib/v2/iwara/subscriptions.js +49 -0
- package/lib/v2/iwara/templates/subscriptions.art +1 -0
- package/lib/v2/leetcode/dailyquestion-solution-cn.js +183 -0
- package/lib/v2/leetcode/dailyquestion-solution-en.js +213 -0
- package/lib/v2/leetcode/maintainer.js +1 -0
- package/lib/v2/leetcode/radar.js +12 -0
- package/lib/v2/leetcode/router.js +2 -0
- package/lib/v2/lovelive-anime/maintainer.js +3 -0
- package/lib/v2/lovelive-anime/news.js +56 -0
- package/lib/v2/lovelive-anime/radar.js +13 -0
- package/lib/v2/lovelive-anime/router.js +3 -0
- package/lib/v2/lovelive-anime/templates/description.art +1 -0
- package/lib/v2/macfilos/blog.js +61 -0
- package/lib/v2/macfilos/maintainer.js +3 -0
- package/lib/v2/macfilos/radar.js +13 -0
- package/lib/v2/macfilos/router.js +3 -0
- package/lib/v2/meteor/boards.js +11 -0
- package/lib/v2/meteor/index.js +45 -0
- package/lib/v2/meteor/maintainer.js +4 -0
- package/lib/v2/meteor/radar.js +19 -0
- package/lib/v2/meteor/router.js +4 -0
- package/lib/v2/meteor/templates/desc.art +7 -0
- package/lib/v2/meteor/utils.js +90 -0
- package/lib/v2/nikkei-cn/index.js +4 -1
- package/lib/v2/nua/gra.js +56 -0
- package/lib/v2/nua/maintainer.js +3 -0
- package/lib/v2/nua/radar.js +13 -0
- package/lib/v2/nua/router.js +3 -0
- package/lib/v2/oschina/maintainer.js +6 -0
- package/lib/{routes → v2}/oschina/news.js +35 -39
- package/lib/v2/oschina/radar.js +33 -0
- package/lib/v2/oschina/router.js +6 -0
- package/lib/v2/oschina/topic.js +53 -0
- package/lib/v2/oschina/user.js +50 -0
- package/lib/v2/plurk/anonymous.js +23 -0
- package/lib/v2/plurk/hotlinks.js +20 -0
- package/lib/v2/plurk/maintainer.js +9 -0
- package/lib/v2/plurk/news.js +23 -0
- package/lib/v2/plurk/radar.js +56 -0
- package/lib/v2/plurk/router.js +9 -0
- package/lib/v2/plurk/search.js +27 -0
- package/lib/v2/plurk/top.js +29 -0
- package/lib/v2/plurk/topic.js +33 -0
- package/lib/v2/plurk/user.js +31 -0
- package/lib/v2/plurk/utils.js +56 -0
- package/lib/v2/segmentfault/blogs.js +38 -0
- package/lib/v2/segmentfault/maintainer.js +1 -0
- package/lib/v2/segmentfault/radar.js +8 -2
- package/lib/v2/segmentfault/router.js +1 -0
- package/lib/v2/sensortower/blog.js +69 -0
- package/lib/v2/sensortower/maintainer.js +3 -0
- package/lib/v2/sensortower/radar.js +13 -0
- package/lib/v2/sensortower/router.js +3 -0
- package/lib/v2/sensortower/templates/description.art +9 -0
- package/lib/v2/taptap/templates/imagePost.art +3 -0
- package/lib/v2/taptap/templates/videoPost.art +2 -1
- package/lib/v2/taptap/topic.js +33 -27
- package/lib/v2/taptap/utils.js +13 -8
- package/lib/v2/test/index.js +15 -0
- package/lib/v2/trending/allTrending.js +46 -19
- package/lib/v2/trending/templates/content.art +1 -0
- package/lib/v2/twitter/maintainer.js +1 -1
- package/lib/v2/twitter/router.js +1 -1
- package/lib/v2/twitter/web-api/twitter-api.js +1 -0
- package/lib/v2/warthunder/maintainer.js +3 -0
- package/lib/v2/warthunder/news.js +49 -0
- package/lib/v2/warthunder/radar.js +13 -0
- package/lib/v2/warthunder/router.js +3 -0
- package/lib/v2/warthunder/templates/description.art +1 -0
- package/lib/v2/xyzrank/index.js +111 -0
- package/lib/v2/xyzrank/maintainer.js +6 -0
- package/lib/v2/xyzrank/radar.js +31 -0
- package/lib/v2/xyzrank/router.js +3 -0
- package/lib/v2/xyzrank/templates/description.art +12 -0
- package/lib/v2/zaobao/util.js +6 -6
- package/lib/v2/zuvio/boards.js +14 -0
- package/lib/v2/zuvio/radar.js +13 -0
- package/lib/v2/zuvio/router.js +4 -0
- package/lib/v2/zuvio/student5.js +58 -0
- package/lib/v2/zuvio/templates/img.art +2 -0
- package/lib/v2/zuvio/templates/link.art +7 -0
- package/lib/v2/zuvio/templates/ref_article.art +8 -0
- package/lib/v2/zuvio/templates/rss.art +1 -0
- package/lib/v2/zuvio/templates/youtube.art +2 -0
- package/lib/v2/zuvio/utils.js +61 -0
- package/package.json +14 -15
- package/lib/routes/oschina/topic.js +0 -54
- package/lib/routes/oschina/u.js +0 -57
- package/lib/routes/oschina/user.js +0 -57
- package/lib/v2/hupu/templates/description.art +0 -6
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const id = ctx.params.id;
|
|
6
|
-
const res = await got({
|
|
7
|
-
method: 'get',
|
|
8
|
-
url: `https://my.oschina.net/${id}`,
|
|
9
|
-
headers: {
|
|
10
|
-
Referer: `https://my.oschina.net/${id}`,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
const $ = cheerio.load(res.data);
|
|
14
|
-
$('div[data-tooltip]').remove();
|
|
15
|
-
const author = $('[data-user-name]').attr('data-user-name');
|
|
16
|
-
const list = $('#newestBlogList').find('.blog-item');
|
|
17
|
-
const count = [];
|
|
18
|
-
for (let i = 0; i < Math.min(list.length, 10); i++) {
|
|
19
|
-
count.push(i);
|
|
20
|
-
}
|
|
21
|
-
const resultItem = await Promise.all(
|
|
22
|
-
count.map(async (i) => {
|
|
23
|
-
const each = $(list[i]);
|
|
24
|
-
const originalUrl = each.find('a.header', '.content').attr('href');
|
|
25
|
-
const item = {
|
|
26
|
-
title: each.find('a.header', '.content').text(),
|
|
27
|
-
description: each.find('p', '.description').text(),
|
|
28
|
-
link: encodeURI(originalUrl),
|
|
29
|
-
};
|
|
30
|
-
const key = 'oschina' + item.link;
|
|
31
|
-
const value = await ctx.cache.get(key);
|
|
32
|
-
|
|
33
|
-
if (value) {
|
|
34
|
-
item.description = value;
|
|
35
|
-
} else {
|
|
36
|
-
const detail = await got({
|
|
37
|
-
method: 'get',
|
|
38
|
-
url: item.link,
|
|
39
|
-
headers: {
|
|
40
|
-
Referer: item.link,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
const content = cheerio.load(detail.data);
|
|
44
|
-
content('.ad-wrap').remove();
|
|
45
|
-
item.description = content('.article-detail').html();
|
|
46
|
-
ctx.cache.set(key, item.description);
|
|
47
|
-
}
|
|
48
|
-
return item;
|
|
49
|
-
})
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
ctx.state.data = {
|
|
53
|
-
title: author + '的博客',
|
|
54
|
-
link: `https://my.oschina.net/${id}`,
|
|
55
|
-
item: resultItem,
|
|
56
|
-
};
|
|
57
|
-
};
|