rsshub 1.0.0-master.fe4f650 → 1.0.0-master.fe560d2
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/README.md +3 -3
- package/lib/config.js +1 -1
- package/lib/middleware/parameter.js +3 -3
- package/lib/radar-rules.js +0 -46
- package/lib/router.js +28 -28
- package/lib/routes/v2ex/post.js +3 -0
- package/lib/utils/puppeteer-utils.js +63 -0
- package/lib/utils/puppeteer.js +13 -8
- package/lib/utils/request-wrapper.js +38 -100
- package/lib/utils/unify-proxy.js +116 -0
- package/lib/utils/wechat-mp.js +2 -0
- package/lib/v2/18comic/utils.js +2 -2
- package/lib/v2/36kr/index.js +29 -24
- package/lib/v2/agora0/maintainer.js +1 -0
- package/lib/v2/agora0/pen0.js +43 -0
- package/lib/v2/agora0/radar.js +12 -1
- package/lib/v2/agora0/router.js +1 -0
- package/lib/v2/aiea/index.js +39 -0
- package/lib/v2/aiea/maintainer.js +3 -0
- package/lib/v2/aiea/radar.js +13 -0
- package/lib/v2/aiea/router.js +3 -0
- package/lib/v2/baidu/radar.js +6 -6
- package/lib/v2/bangumi/online/online.js +4 -2
- package/lib/v2/bangumi/tv/group/reply.js +13 -1
- package/lib/v2/bangumi/tv/group/topic.js +22 -9
- package/lib/v2/bilibili/cache.js +34 -1
- package/lib/v2/bilibili/userCollection.js +1 -2
- package/lib/v2/bilibili/utils.js +10 -0
- package/lib/v2/bilibili/video-all.js +5 -2
- package/lib/v2/bilibili/video.js +3 -1
- package/lib/v2/bytes/bytes.js +25 -0
- package/lib/v2/bytes/maintainer.js +4 -0
- package/lib/v2/bytes/radar.js +13 -0
- package/lib/v2/bytes/router.js +3 -0
- package/lib/v2/caijing/maintainer.js +3 -0
- package/lib/v2/caijing/radar.js +13 -0
- package/lib/v2/caijing/roll.js +46 -0
- package/lib/v2/caijing/router.js +3 -0
- package/lib/v2/cdzjryb/maintainer.js +3 -0
- package/lib/v2/cdzjryb/projectList.js +49 -0
- package/lib/v2/cdzjryb/radar.js +13 -0
- package/lib/v2/cdzjryb/router.js +3 -0
- package/lib/v2/cdzjryb/templates/projectList.art +23 -0
- package/lib/v2/chsi/kydt.js +51 -0
- package/lib/v2/chsi/maintainer.js +3 -0
- package/lib/v2/chsi/radar.js +13 -0
- package/lib/v2/chsi/router.js +3 -0
- package/lib/v2/cnbeta/radar.js +6 -6
- package/lib/v2/cnbeta/router.js +1 -1
- package/lib/v2/cnbeta/type.js +6 -12
- package/lib/v2/cnbeta/utils.js +5 -8
- package/lib/v2/cngal/entry.js +25 -0
- package/lib/v2/cngal/maintainer.js +4 -0
- package/lib/v2/cngal/radar.js +19 -0
- package/lib/v2/cngal/router.js +4 -0
- package/lib/v2/cngal/templates/entry-description.art +4 -0
- package/lib/v2/cngal/templates/weekly-description.art +4 -0
- package/lib/v2/cngal/weekly.js +20 -0
- package/lib/v2/cnki/author.js +45 -0
- package/lib/v2/cnki/journals.js +2 -23
- package/lib/v2/cnki/maintainer.js +1 -0
- package/lib/v2/cnki/radar.js +8 -0
- package/lib/v2/cnki/router.js +1 -0
- package/lib/v2/cnki/utils.js +26 -0
- package/lib/v2/codeforces/maintainer.js +1 -0
- package/lib/v2/codeforces/radar.js +8 -0
- package/lib/v2/codeforces/recent_actions.js +47 -0
- package/lib/v2/codeforces/router.js +1 -0
- package/lib/v2/curius/links.js +43 -0
- package/lib/v2/curius/maintainer.js +3 -0
- package/lib/v2/curius/radar.js +13 -0
- package/lib/v2/curius/router.js +3 -0
- package/lib/v2/curius/templates/description.art +16 -0
- package/lib/v2/douyin/hashtag.js +20 -19
- package/lib/v2/douyin/live.js +2 -21
- package/lib/v2/douyin/user.js +2 -17
- package/lib/v2/douyin/utils.js +85 -0
- package/lib/v2/{acm-ecnu → ecnu}/contest.js +1 -4
- package/lib/v2/ecnu/maintainer.js +4 -0
- package/lib/v2/ecnu/radar.js +30 -0
- package/lib/v2/ecnu/router.js +4 -0
- package/lib/v2/{acm-ecnu → ecnu}/templates/description.art +0 -0
- package/lib/v2/ecnu/yjs.js +37 -0
- package/lib/v2/ehentai/ehapi.js +23 -12
- package/lib/v2/foresightnews/index.js +8 -11
- package/lib/v2/foreverblog/feeds.js +36 -0
- package/lib/v2/foreverblog/maintainer.js +3 -0
- package/lib/v2/foreverblog/radar.js +13 -0
- package/lib/v2/foreverblog/router.js +3 -0
- package/lib/v2/freewechat/maintainer.js +3 -0
- package/lib/v2/freewechat/profile.js +61 -0
- package/lib/v2/freewechat/radar.js +13 -0
- package/lib/v2/freewechat/router.js +3 -0
- package/lib/v2/gcores/category.js +16 -6
- package/lib/v2/good/index.js +15 -14
- package/lib/v2/gov/customs/list.js +1 -1
- package/lib/v2/gov/dianbai/dianbai.js +18 -0
- package/lib/v2/gov/gaozhou/gaozhou.js +19 -0
- package/lib/v2/gov/general/general.js +250 -0
- package/lib/v2/gov/general/templates/zcjdpt.art +128 -0
- package/lib/v2/gov/gz/index.js +38 -0
- package/lib/v2/gov/huazhou/huazhou.js +19 -0
- package/lib/v2/gov/hunan/changsha/major-email.js +52 -0
- package/lib/v2/gov/maintainer.js +19 -2
- package/lib/v2/gov/maoming/maoming.js +417 -0
- package/lib/v2/gov/maonan/maonan.js +100 -0
- package/lib/v2/gov/mgs/mgs.js +19 -0
- package/lib/v2/gov/mmht/mmht.js +19 -0
- package/lib/v2/gov/nmpa/generic.js +1 -1
- package/lib/v2/gov/radar.js +197 -0
- package/lib/v2/gov/router.js +18 -2
- package/lib/v2/gov/sasac/generic.js +42 -0
- package/lib/v2/gov/sdb/sdb.js +19 -0
- package/lib/v2/gov/shanghai/yjj/index.js +3 -1
- package/lib/v2/gov/xinyi/xinyi.js +19 -0
- package/lib/v2/gov/zhengce/govall.js +55 -0
- package/lib/v2/gov/zhengce/wenjian.js +47 -0
- package/lib/v2/gov/zhengce/zhengceku.js +22 -0
- package/lib/v2/gov/zhengce/zuixin.js +39 -0
- package/lib/v2/guanhai/index.js +47 -0
- package/lib/v2/guanhai/maintainer.js +4 -0
- package/lib/v2/guanhai/radar.js +13 -0
- package/lib/v2/guanhai/router.js +3 -0
- package/lib/v2/hackernews/index.js +6 -0
- package/lib/v2/hellogithub/volume.js +15 -32
- package/lib/v2/{heu → hrbeu}/gx/card.js +5 -10
- package/lib/v2/{heu → hrbeu}/gx/list.js +12 -20
- package/lib/v2/hrbeu/job/bigemploy.js +25 -0
- package/lib/v2/{heu → hrbeu}/job/calendar.js +8 -16
- package/lib/v2/{heu → hrbeu}/job/list.js +11 -16
- package/lib/v2/{heu → hrbeu}/maintainer.js +2 -1
- package/lib/v2/{heu → hrbeu}/radar.js +18 -10
- package/lib/v2/{heu → hrbeu}/router.js +3 -2
- package/lib/v2/{heu → hrbeu}/uae/list.js +12 -17
- package/lib/v2/hrbeu/ugs/news.js +98 -0
- package/lib/v2/{heu → hrbeu}/yjsy/list.js +8 -16
- package/lib/v2/ieee-security/maintainer.js +3 -0
- package/lib/v2/ieee-security/radar.js +13 -0
- package/lib/v2/ieee-security/router.js +3 -0
- package/lib/v2/ieee-security/sp.js +36 -0
- package/lib/v2/javbus/index.js +8 -2
- package/lib/v2/javbus/templates/description.art +12 -1
- package/lib/v2/jike/user.js +1 -0
- package/lib/v2/lang/maintainer.js +3 -0
- package/lib/v2/lang/radar.js +13 -0
- package/lib/v2/lang/room.js +40 -0
- package/lib/v2/lang/router.js +3 -0
- package/lib/v2/lang/templates/room.art +1 -0
- package/lib/v2/liulinblog/utils.js +7 -4
- package/lib/v2/luogu/daily.js +1 -1
- package/lib/v2/mangadex/index.js +73 -0
- package/lib/v2/mangadex/maintainer.js +3 -0
- package/lib/v2/mangadex/radar.js +13 -0
- package/lib/v2/mangadex/router.js +3 -0
- package/lib/v2/mihoyo/ys/news.js +3 -2
- package/lib/v2/mirror/index.js +15 -8
- package/lib/v2/mrdx/daily.js +79 -0
- package/lib/v2/mrdx/maintainer.js +3 -0
- package/lib/v2/mrdx/radar.js +13 -0
- package/lib/v2/mrdx/router.js +3 -0
- package/lib/v2/mrdx/utils.js +17 -0
- package/lib/v2/mtime/news.js +1 -1
- package/lib/v2/nautil/maintainer.js +3 -0
- package/lib/v2/nautil/radar.js +13 -0
- package/lib/v2/nautil/router.js +3 -0
- package/lib/v2/nautil/templates/description.art +6 -0
- package/lib/v2/nautil/topics.js +57 -0
- package/lib/v2/ndss-symposium/maintainer.js +3 -0
- package/lib/v2/ndss-symposium/ndss.js +80 -0
- package/lib/v2/ndss-symposium/radar.js +13 -0
- package/lib/v2/ndss-symposium/router.js +3 -0
- package/lib/v2/nextapple/realtime.js +1 -1
- package/lib/v2/nintendo/direct.js +31 -0
- package/lib/v2/nintendo/eshop_cn.js +44 -0
- package/lib/v2/nintendo/eshop_hk.js +79 -0
- package/lib/v2/nintendo/eshop_jp.js +34 -0
- package/lib/v2/nintendo/eshop_us.js +32 -0
- package/lib/v2/nintendo/maintainer.js +7 -0
- package/lib/v2/nintendo/news.js +23 -0
- package/lib/v2/nintendo/news_china.js +35 -0
- package/lib/v2/nintendo/radar.js +70 -0
- package/lib/v2/nintendo/router.js +10 -0
- package/lib/{routes → v2}/nintendo/system-update.js +2 -2
- package/lib/v2/nintendo/templates/direct.art +6 -0
- package/lib/v2/nintendo/templates/eshop_cn.art +21 -0
- package/lib/v2/nintendo/templates/eshop_hk.art +61 -0
- package/lib/v2/nintendo/templates/eshop_jp.art +3 -0
- package/lib/v2/nintendo/templates/eshop_us.art +24 -0
- package/lib/{routes → v2}/nintendo/utils.js +34 -50
- package/lib/v2/njxzc/home.js +13 -9
- package/lib/v2/nmtv/column.js +53 -0
- package/lib/v2/nmtv/maintainer.js +3 -0
- package/lib/v2/nmtv/radar.js +13 -0
- package/lib/v2/nmtv/router.js +3 -0
- package/lib/v2/nmtv/templates/description.art +9 -0
- package/lib/v2/nua/lib.js +39 -0
- package/lib/v2/nua/maintainer.js +1 -0
- package/lib/v2/nua/radar.js +8 -0
- package/lib/v2/nua/router.js +1 -0
- package/lib/v2/nua/utils.js +7 -12
- package/lib/v2/nuaa/utils/pypasswaf.js +3 -2
- package/lib/v2/nyaa/main.js +16 -23
- package/lib/v2/nyaa/maintainer.js +7 -4
- package/lib/v2/nyaa/radar.js +27 -29
- package/lib/v2/nyaa/router.js +4 -2
- package/lib/v2/odaily/post.js +15 -20
- package/lib/v2/odaily/utils.js +1 -1
- package/lib/v2/paradigm/maintainer.js +3 -0
- package/lib/v2/paradigm/radar.js +13 -0
- package/lib/v2/paradigm/router.js +3 -0
- package/lib/v2/paradigm/writing.js +44 -0
- package/lib/v2/picuki/maintainer.js +1 -1
- package/lib/v2/picuki/profile.js +10 -8
- package/lib/v2/picuki/utils.js +21 -0
- package/lib/v2/pixiv/api/getRanking.js +1 -1
- package/lib/v2/pixiv/ranking.js +3 -0
- package/lib/v2/producthunt/templates/descImg.art +2 -2
- package/lib/v2/qlu/maintainer.js +3 -0
- package/lib/v2/qlu/notice.js +54 -0
- package/lib/v2/qlu/radar.js +13 -0
- package/lib/v2/qlu/router.js +3 -0
- package/lib/v2/reactnewsletter/maintainer.js +4 -0
- package/lib/v2/reactnewsletter/radar.js +13 -0
- package/lib/v2/reactnewsletter/reactnewsletter.js +25 -0
- package/lib/v2/reactnewsletter/router.js +3 -0
- package/lib/v2/researchgate/maintainer.js +3 -0
- package/lib/v2/researchgate/publications.js +70 -0
- package/lib/v2/researchgate/radar.js +13 -0
- package/lib/v2/researchgate/router.js +3 -0
- package/lib/v2/saraba1st/digest.js +79 -0
- package/lib/v2/saraba1st/maintainer.js +1 -0
- package/lib/v2/saraba1st/radar.js +12 -3
- package/lib/v2/saraba1st/router.js +1 -0
- package/lib/v2/saraba1st/templates/digest.art +5 -0
- package/lib/v2/sctv/maintainer.js +1 -1
- package/lib/v2/sctv/programme.js +39 -17
- package/lib/v2/sctv/router.js +1 -1
- package/lib/v2/shmtu/jwc.js +57 -0
- package/lib/v2/shmtu/maintainer.js +5 -0
- package/lib/v2/shmtu/portal.js +81 -0
- package/lib/v2/shmtu/radar.js +29 -0
- package/lib/v2/shmtu/router.js +5 -0
- package/lib/v2/shmtu/templates/portal.art +30 -0
- package/lib/v2/shmtu/www.js +58 -0
- package/lib/v2/sigsac/ccs.js +57 -0
- package/lib/v2/sigsac/maintainer.js +3 -0
- package/lib/v2/sigsac/radar.js +13 -0
- package/lib/v2/sigsac/router.js +3 -0
- package/lib/v2/simpleinfo/index.js +50 -0
- package/lib/v2/simpleinfo/maintainer.js +3 -0
- package/lib/v2/simpleinfo/radar.js +19 -0
- package/lib/v2/simpleinfo/router.js +3 -0
- package/lib/v2/simpleinfo/templates/description.art +6 -0
- package/lib/v2/sse/maintainer.js +1 -1
- package/lib/v2/telegram/channel.js +54 -38
- package/lib/v2/tencent/maintainer.js +2 -0
- package/lib/v2/tencent/news/coronavirus/data.js +71 -0
- package/lib/v2/tencent/news/coronavirus/total.js +34 -0
- package/lib/v2/tencent/news/coronavirus/utils.js +17 -0
- package/lib/v2/tencent/radar.js +8 -0
- package/lib/v2/tencent/router.js +2 -0
- package/lib/v2/tencent/templates/coronavirus/chinaTotal.art +6 -0
- package/lib/v2/tencent/templates/coronavirus/data.art +4 -0
- package/lib/v2/test/index.js +8 -0
- package/lib/v2/theverge/index.js +9 -1
- package/lib/v2/theverge/maintainer.js +1 -1
- package/lib/v2/theverge/radar.js +2 -2
- package/lib/v2/theverge/router.js +1 -1
- package/lib/v2/tingshuitz/changsha.js +43 -0
- package/lib/v2/tingshuitz/maintainer.js +1 -0
- package/lib/v2/tingshuitz/radar.js +10 -0
- package/lib/v2/tingshuitz/router.js +1 -0
- package/lib/v2/twitter/web-api/twitter-api.js +19 -15
- package/lib/v2/twreporter/category.js +17 -8
- package/lib/v2/uber/blog.js +59 -0
- package/lib/v2/uber/maintainer.js +3 -0
- package/lib/v2/uber/radar.js +13 -0
- package/lib/v2/uber/router.js +3 -0
- package/lib/v2/usenix/maintainer.js +3 -0
- package/lib/v2/usenix/radar.js +13 -0
- package/lib/v2/usenix/router.js +3 -0
- package/lib/v2/usenix/usenix.js +63 -0
- package/lib/v2/usepanda/index.js +26 -0
- package/lib/v2/usepanda/maintainer.js +3 -0
- package/lib/v2/usepanda/radar.js +11 -0
- package/lib/v2/usepanda/router.js +3 -0
- package/lib/v2/uw/gix/news.js +67 -0
- package/lib/v2/uw/maintainer.js +3 -0
- package/lib/v2/uw/radar.js +13 -0
- package/lib/v2/uw/router.js +3 -0
- package/lib/v2/verse/articles.js +42 -0
- package/lib/v2/verse/maintainer.js +3 -0
- package/lib/v2/verse/radar.js +13 -0
- package/lib/v2/verse/router.js +3 -0
- package/lib/{routes → v2}/weibo/keyword.js +2 -2
- package/lib/v2/weibo/maintainer.js +8 -0
- package/lib/v2/weibo/oasis/user.js +20 -0
- package/lib/v2/weibo/radar.js +48 -0
- package/lib/v2/weibo/router.js +8 -0
- package/lib/{routes → v2}/weibo/search/hot.js +2 -0
- package/lib/{routes → v2}/weibo/super_index.js +2 -2
- package/lib/{routes → v2}/weibo/timeline.js +2 -2
- package/lib/{routes → v2}/weibo/user.js +2 -2
- package/lib/{routes → v2}/weibo/utils.js +49 -14
- package/lib/v2/ymgal/article.js +61 -0
- package/lib/v2/ymgal/game.js +41 -0
- package/lib/v2/ymgal/maintainer.js +4 -0
- package/lib/v2/ymgal/radar.js +31 -0
- package/lib/v2/ymgal/router.js +4 -0
- package/lib/v2/ymgal/templates/description.art +7 -0
- package/lib/v2/zhihu/pin/utils.js +49 -41
- package/package.json +26 -27
- package/lib/routes/blogs/foreverblog.js +0 -33
- package/lib/routes/gov/zhengce/govall.js +0 -59
- package/lib/routes/gov/zhengce/wenjian.js +0 -53
- package/lib/routes/gov/zhengce/zuixin.js +0 -42
- package/lib/routes/langlive/room.js +0 -33
- package/lib/routes/nautilus/topics.js +0 -45
- package/lib/routes/nintendo/direct.js +0 -34
- package/lib/routes/nintendo/eshop_cn.js +0 -51
- package/lib/routes/nintendo/eshop_hk.js +0 -26
- package/lib/routes/nintendo/eshop_jp.js +0 -20
- package/lib/routes/nintendo/eshop_us.js +0 -36
- package/lib/routes/nintendo/news.js +0 -25
- package/lib/routes/nintendo/news_china.js +0 -41
- package/lib/routes/researchgate/publications.js +0 -60
- package/lib/routes/universities/ecnuyjs/ecnuyjs.js +0 -23
- package/lib/routes/universities/shmtu/jwc.js +0 -75
- package/lib/routes/universities/shmtu/www.js +0 -61
- package/lib/routes/weibo/oasis/user.js +0 -17
- package/lib/v2/acm-ecnu/maintainer.js +0 -3
- package/lib/v2/acm-ecnu/radar.js +0 -19
- package/lib/v2/acm-ecnu/router.js +0 -3
- package/lib/v2/cnbeta/index.js +0 -16
- package/lib/v2/heu/job/bigemploy.js +0 -42
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
const gixBaseURL = 'https://gixnetwork.org';
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const category = ctx.params.category;
|
|
8
|
+
|
|
9
|
+
let newsURL = gixBaseURL + '/news';
|
|
10
|
+
let feedTitle = 'UW GIX News - ';
|
|
11
|
+
let listSelector = 'body > div.site > div.site-content > div.content-area > main.site-main > ';
|
|
12
|
+
|
|
13
|
+
switch (category) {
|
|
14
|
+
case 'blog':
|
|
15
|
+
newsURL += '/blog/';
|
|
16
|
+
feedTitle += 'Blogs';
|
|
17
|
+
listSelector += 'div.blog-wrapper > section.blog-list > article';
|
|
18
|
+
break;
|
|
19
|
+
case 'inthenews':
|
|
20
|
+
newsURL += '/inthenews/';
|
|
21
|
+
feedTitle += 'In The News';
|
|
22
|
+
listSelector += 'div.news-wrapper > section.news-list > article';
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const response = await got(newsURL);
|
|
27
|
+
|
|
28
|
+
const data = response.data;
|
|
29
|
+
|
|
30
|
+
const $ = cheerio.load(data);
|
|
31
|
+
|
|
32
|
+
const list = $(listSelector)
|
|
33
|
+
.map((index, item) => {
|
|
34
|
+
item = $(item);
|
|
35
|
+
const content = item.find('header').find('h2').find('a');
|
|
36
|
+
const time = item.find('header').find('span.h4').text();
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
// title: content.text(),
|
|
40
|
+
time,
|
|
41
|
+
link: content.attr('href'),
|
|
42
|
+
};
|
|
43
|
+
})
|
|
44
|
+
.get();
|
|
45
|
+
|
|
46
|
+
const itemContent = await Promise.all(
|
|
47
|
+
list.map((item) =>
|
|
48
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
49
|
+
const descriptionResponse = await got(item.link);
|
|
50
|
+
|
|
51
|
+
const content = cheerio.load(descriptionResponse.data);
|
|
52
|
+
|
|
53
|
+
item.title = content('header.entry-header').find('h1').text();
|
|
54
|
+
item.description = content('div.entry-content').html();
|
|
55
|
+
item.pubDate = Date.parse(item.time);
|
|
56
|
+
|
|
57
|
+
return item;
|
|
58
|
+
})
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
ctx.state.data = {
|
|
63
|
+
title: feedTitle,
|
|
64
|
+
link: newsURL,
|
|
65
|
+
item: itemContent,
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'gixnetwork.org': {
|
|
3
|
+
_name: 'University of Washington',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: 'Global Innovation Exchange News',
|
|
7
|
+
docs: 'https://docs.rsshub.app/university.html#university-of-washington',
|
|
8
|
+
source: ['/news/:category'],
|
|
9
|
+
target: '/uw/gix/news/:category',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const category = ctx.params.category;
|
|
8
|
+
const rootUrl = 'https://www.verse.com.tw/articles';
|
|
9
|
+
const currentUrl = category ? `${rootUrl}/${category}/` : rootUrl;
|
|
10
|
+
const response = await got(currentUrl);
|
|
11
|
+
const $ = cheerio.load(response.data);
|
|
12
|
+
const items = await Promise.all(
|
|
13
|
+
$('.templateA__list .templateA__listTitle a')
|
|
14
|
+
.get()
|
|
15
|
+
.map((item) => {
|
|
16
|
+
item = $(item);
|
|
17
|
+
const link = item.attr('href');
|
|
18
|
+
return ctx.cache.tryGet(link, async () => {
|
|
19
|
+
const response = await got(link);
|
|
20
|
+
const $ = cheerio.load(response.data);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
title: $('title').text(),
|
|
24
|
+
author: $('#__author').first().text(),
|
|
25
|
+
description: $('.article__template').html(),
|
|
26
|
+
category: $('.article__infoType .category a')
|
|
27
|
+
.toArray()
|
|
28
|
+
.map((item) => $(item).text()),
|
|
29
|
+
pubDate: timezone(parseDate($('.article__data').text(), '日期 YYYY/MM/DD'), +8),
|
|
30
|
+
link,
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
ctx.state.data = {
|
|
37
|
+
title: $('title').text(),
|
|
38
|
+
link: currentUrl,
|
|
39
|
+
description: $('meta[name="description"]').attr('content'),
|
|
40
|
+
item: items,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -28,7 +28,7 @@ module.exports = async (ctx) => {
|
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
const routeParams = querystring.parse(ctx.params.routeParams);
|
|
31
|
-
ctx.state.data = {
|
|
31
|
+
ctx.state.data = weiboUtils.sinaimgTvax({
|
|
32
32
|
title: `又有人在微博提到${keyword}了`,
|
|
33
33
|
link: `http://s.weibo.com/weibo/${encodeURIComponent(keyword)}&b=1&nodup=1`,
|
|
34
34
|
description: `又有人在微博提到${keyword}了`,
|
|
@@ -51,5 +51,5 @@ module.exports = async (ctx) => {
|
|
|
51
51
|
link: `https://weibo.com/${item.mblog.user.id}/${item.mblog.bid}`,
|
|
52
52
|
};
|
|
53
53
|
}),
|
|
54
|
-
};
|
|
54
|
+
});
|
|
55
55
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'/keyword/:keyword/:routeParams?': ['DIYgod'],
|
|
3
|
+
'/oasis/user/:userid': ['kt286'],
|
|
4
|
+
'/search/hot': ['xyqfer'],
|
|
5
|
+
'/super_index/:id/:type?/:routeParams?': ['zengxs'],
|
|
6
|
+
'/timeline/:uid/:feature?/:routeParams?': ['zytomorrow', 'DIYgod ', 'Rongronggg9'],
|
|
7
|
+
'/user/:uid/:routeParams?': ['DIYgod', 'iplusx', 'Rongronggg9'],
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const buildData = require('@/utils/common-config');
|
|
2
|
+
const weiboUtils = require('../utils');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const userid = ctx.params.userid;
|
|
6
|
+
const link = `https://oasis.weibo.cn/v1/h5/share?uid=${userid}`;
|
|
7
|
+
ctx.state.data = weiboUtils.sinaimgTvax(
|
|
8
|
+
await buildData({
|
|
9
|
+
link,
|
|
10
|
+
url: link,
|
|
11
|
+
title: `$('.name-main').text().trim() + ' - 用户 - 绿洲'`,
|
|
12
|
+
description: `$('.desc').text().trim()`,
|
|
13
|
+
item: {
|
|
14
|
+
item: '.container .item',
|
|
15
|
+
title: `$('.status-desc').text()`,
|
|
16
|
+
description: `$('.status-desc').text() + '<br>' + $('.media-wrapper').html()`,
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'weibo.com': {
|
|
3
|
+
_name: '微博',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '博主',
|
|
7
|
+
docs: 'https://docs.rsshub.app/social-media.html#wei-bo',
|
|
8
|
+
source: ['/u/:id', '/:id'],
|
|
9
|
+
target: (params, url, document) => {
|
|
10
|
+
let uid = document?.documentElement.innerHTML.match(/\$CONFIG\['oid']='(\d+)'/)?.[1];
|
|
11
|
+
if (!uid && !isNaN(params.id)) {
|
|
12
|
+
uid = params.id;
|
|
13
|
+
}
|
|
14
|
+
return uid ? `/weibo/user/${uid}` : '';
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '关键词',
|
|
19
|
+
docs: 'https://docs.rsshub.app/social-media.html#wei-bo',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
title: '超话',
|
|
23
|
+
docs: 'https://docs.rsshub.app/social-media.html#wei-bo',
|
|
24
|
+
source: '/p/:id/super_index',
|
|
25
|
+
target: '/weibo/super_index/:id',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
s: [
|
|
29
|
+
{
|
|
30
|
+
title: '热搜榜',
|
|
31
|
+
docs: 'https://docs.rsshub.app/social-media.html#wei-bo',
|
|
32
|
+
source: '/top/summary',
|
|
33
|
+
target: '/weibo/search/hot',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
'weibo.cn': {
|
|
38
|
+
_name: '微博',
|
|
39
|
+
m: [
|
|
40
|
+
{
|
|
41
|
+
title: '博主',
|
|
42
|
+
docs: 'https://docs.rsshub.app/social-media.html#wei-bo',
|
|
43
|
+
source: ['/u/:uid', '/profile/:uid'],
|
|
44
|
+
target: '/weibo/user/:uid',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module.exports = (router) => {
|
|
2
|
+
router.get('/keyword/:keyword/:routeParams?', require('./keyword'));
|
|
3
|
+
router.get('/oasis/user/:userid', require('./oasis/user'));
|
|
4
|
+
router.get('/search/hot', require('./search/hot'));
|
|
5
|
+
router.get('/super_index/:id/:type?/:routeParams?', require('./super_index'));
|
|
6
|
+
router.get('/timeline/:uid/:feature?/:routeParams?', require('./timeline'));
|
|
7
|
+
router.get('/user/:uid/:routeParams?', require('./user'));
|
|
8
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
+
// const weiboUtils = require('../utils');
|
|
2
3
|
|
|
3
4
|
module.exports = async (ctx) => {
|
|
4
5
|
const {
|
|
@@ -30,4 +31,5 @@ module.exports = async (ctx) => {
|
|
|
30
31
|
};
|
|
31
32
|
}),
|
|
32
33
|
};
|
|
34
|
+
// ctx.state.data = weiboUtils.sinaimgTvax(ctx.state.data); // no image in the route
|
|
33
35
|
};
|
|
@@ -53,10 +53,10 @@ module.exports = async (ctx) => {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
ctx.state.data = {
|
|
56
|
+
ctx.state.data = weiboUtils.sinaimgTvax({
|
|
57
57
|
title: `微博超话 - ${containerData.pageInfo.page_title}`,
|
|
58
58
|
link: `https://weibo.com/p/${id}/super_index`,
|
|
59
59
|
description: `#${containerData.pageInfo.page_title}# 的超话`,
|
|
60
60
|
item: resultItems,
|
|
61
|
-
};
|
|
61
|
+
});
|
|
62
62
|
};
|
|
@@ -125,13 +125,13 @@ module.exports = async (ctx) => {
|
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
127
|
|
|
128
|
-
ctx.state.data = {
|
|
128
|
+
ctx.state.data = weiboUtils.sinaimgTvax({
|
|
129
129
|
title: `个人微博时间线--${name}`,
|
|
130
130
|
link: `http://weibo.com/${uid}/`,
|
|
131
131
|
description,
|
|
132
132
|
image: profileImageUrl,
|
|
133
133
|
item: resultItem,
|
|
134
|
-
};
|
|
134
|
+
});
|
|
135
135
|
} else if (uid === '0' || ctx.querystring) {
|
|
136
136
|
const { app_key = '', redirect_url = ctx.request.origin + '/weibo/timeline/0', app_secret = '' } = config.weibo;
|
|
137
137
|
|
|
@@ -145,11 +145,11 @@ module.exports = async (ctx) => {
|
|
|
145
145
|
resultItems = ordinaryItems;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
ctx.state.data = {
|
|
148
|
+
ctx.state.data = weiboUtils.sinaimgTvax({
|
|
149
149
|
title: `${name}的微博`,
|
|
150
150
|
link: `https://weibo.com/${uid}/`,
|
|
151
151
|
description,
|
|
152
152
|
image: profileImageUrl,
|
|
153
153
|
item: resultItems,
|
|
154
|
-
};
|
|
154
|
+
});
|
|
155
155
|
};
|
|
@@ -4,6 +4,16 @@ const cheerio = require('cheerio');
|
|
|
4
4
|
const { fallback, queryToBoolean, queryToInteger } = require('@/utils/readable-social');
|
|
5
5
|
|
|
6
6
|
const weiboUtils = {
|
|
7
|
+
formatTitle: (html) =>
|
|
8
|
+
html
|
|
9
|
+
.replace(/<span class=["']url-icon["']><img\s[^>]*?alt=["']?([^>]+?)["']?\s[^>]*?\/?><\/span>/g, '$1') // 表情转换
|
|
10
|
+
.replace(/<span class=["']url-icon["']>(<img\s[^>]*>)<\/span>/g, '') // 去掉所有图标
|
|
11
|
+
.replace(/<img\s[^<]*>/g, '[图片]')
|
|
12
|
+
// impossible to have inline script in weibo posts, but CodeQL complains about it
|
|
13
|
+
// Dismiss it through the UI: https://github.com/github/codeql/issues/11427
|
|
14
|
+
.replace(/<[^<]*>/g, '')
|
|
15
|
+
.replace(/\n/g, ' ')
|
|
16
|
+
.trim(),
|
|
7
17
|
formatExtended: (ctx, status, params = {}, picsPrefixes = []) => {
|
|
8
18
|
// undefined and strings like "1" is also safely parsed, so no if branch is needed
|
|
9
19
|
const routeParams = querystring.parse(ctx.params.routeParams);
|
|
@@ -90,6 +100,13 @@ const weiboUtils = {
|
|
|
90
100
|
html = usernameAndAvatar + html;
|
|
91
101
|
}
|
|
92
102
|
|
|
103
|
+
// status.pics can be either an array or an object:
|
|
104
|
+
// array: [ object, object, ... ]
|
|
105
|
+
// object: { '0': object, '1': object, ... } // REALLY AMAZING data structure
|
|
106
|
+
if (status.pics && !Array.isArray(status.pics) && typeof status.pics === 'object') {
|
|
107
|
+
status.pics = Object.values(status.pics);
|
|
108
|
+
}
|
|
109
|
+
|
|
93
110
|
// 添加文章头图,此处不需要回落到被转发的微博,后续处理被转发的微博时,还会执行到这里
|
|
94
111
|
if (status.page_info && status.page_info.type === 'article' && status.page_info.page_pic && status.page_info.page_pic.url) {
|
|
95
112
|
// 如果以后后续流程会用到其他字段,记得修改这里
|
|
@@ -200,23 +217,11 @@ const weiboUtils = {
|
|
|
200
217
|
title += status.user.screen_name + ': ';
|
|
201
218
|
}
|
|
202
219
|
if (!status.retweeted_status || showRetweetTextInTitle) {
|
|
203
|
-
title += htmlNewLineUnreplaced
|
|
204
|
-
.replace(/<span class=["']url-icon["']><img\s[^>]*?alt=["']?([^>]+?)["']?\s[^>]*?\/><\/span>/g, '$1') // 表情转换
|
|
205
|
-
.replace(/<span class=["']url-icon["']>(<img\s[^>]*?>)<\/span>/g, '') // 去掉所有图标
|
|
206
|
-
.replace(/<img[\s\S]*?>/g, '[图片]')
|
|
207
|
-
.replace(/<.*?>/g, '')
|
|
208
|
-
.replace('\n', '')
|
|
209
|
-
.trim();
|
|
220
|
+
title += weiboUtils.formatTitle(htmlNewLineUnreplaced);
|
|
210
221
|
}
|
|
211
222
|
if (status.retweeted_status) {
|
|
212
223
|
title += showEmojiForRetweet ? '🔁 ' : ' - 转发 ';
|
|
213
|
-
title += retweeted
|
|
214
|
-
.replace(/<span class=["']url-icon["']><img\s[^>]*?alt=["']?([^>]+?)["']?\s[^>]*?\/><\/span>/g, '$1') // 表情转换
|
|
215
|
-
.replace(/<span class=["']url-icon["']>(<img\s[^>]*?>)<\/span>/g, '') // 去掉所有图标
|
|
216
|
-
.replace(/<img[\s\S]*?>/g, '[图片]')
|
|
217
|
-
.replace(/<.*?>/g, '')
|
|
218
|
-
.replace('\n', '')
|
|
219
|
-
.trim();
|
|
224
|
+
title += weiboUtils.formatTitle(retweeted);
|
|
220
225
|
}
|
|
221
226
|
if (livePhotoCount > 0) {
|
|
222
227
|
title += ' ';
|
|
@@ -417,6 +422,36 @@ const weiboUtils = {
|
|
|
417
422
|
}
|
|
418
423
|
return itemDesc;
|
|
419
424
|
},
|
|
425
|
+
sinaimgTvax: (() => {
|
|
426
|
+
// https://datatracker.ietf.org/doc/html/rfc1808#section-2.4.3
|
|
427
|
+
const regex = /(?<=\/\/)wx(?=[1-4]\.sinaimg\.cn\/)/gi;
|
|
428
|
+
const prefixes = ['tva', 'tvax'];
|
|
429
|
+
let cnt = 0;
|
|
430
|
+
const replace = (html) => {
|
|
431
|
+
cnt = (cnt + 1) % 2;
|
|
432
|
+
return html.replace(regex, prefixes[cnt]);
|
|
433
|
+
};
|
|
434
|
+
const replaceKV = (obj, keys) => {
|
|
435
|
+
keys.forEach((key) => {
|
|
436
|
+
if (obj[key]) {
|
|
437
|
+
obj[key] = replace(obj[key]);
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
};
|
|
441
|
+
const dataKeys = ['description', 'image'];
|
|
442
|
+
const itemKeys = ['description'];
|
|
443
|
+
return (data) => {
|
|
444
|
+
if (data) {
|
|
445
|
+
replaceKV(data, dataKeys);
|
|
446
|
+
if (data.item) {
|
|
447
|
+
data.item.forEach((item) => {
|
|
448
|
+
replaceKV(item, itemKeys);
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return data;
|
|
453
|
+
};
|
|
454
|
+
})(),
|
|
420
455
|
};
|
|
421
456
|
|
|
422
457
|
module.exports = weiboUtils;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
const host = 'https://www.ymgal.games';
|
|
7
|
+
|
|
8
|
+
const types = {
|
|
9
|
+
news: '?type=NEWS&page=1',
|
|
10
|
+
column: '?type=COLUMN&page=1',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports = async (ctx) => {
|
|
14
|
+
const type = ctx.params.type || 'all';
|
|
15
|
+
|
|
16
|
+
const link = `${host}/co/topic/list` + types[type];
|
|
17
|
+
let data = [];
|
|
18
|
+
if (type === 'all') {
|
|
19
|
+
await Promise.all(
|
|
20
|
+
Object.values(types).map(async (type) => {
|
|
21
|
+
const response = await got(`${host}/co/topic/list${type}`);
|
|
22
|
+
data.push.apply(data, response.data.data);
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
data = data.sort((a, b) => b.publishTime - a.publishTime).slice(0, 10);
|
|
26
|
+
} else {
|
|
27
|
+
const response = await got(link);
|
|
28
|
+
data = response.data.data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const items = await Promise.all(
|
|
32
|
+
data.map((item) => {
|
|
33
|
+
const itemUrl = host + '/co/article/' + item.topicId;
|
|
34
|
+
return ctx.cache.tryGet(itemUrl, async () => {
|
|
35
|
+
const result = await got(itemUrl);
|
|
36
|
+
const $ = cheerio.load(result.data);
|
|
37
|
+
const description = $('article').html().trim();
|
|
38
|
+
return {
|
|
39
|
+
title: item.title,
|
|
40
|
+
link: itemUrl,
|
|
41
|
+
pubDate: timezone(parseDate(item.publishTime), 8),
|
|
42
|
+
description,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
let info = '全部文章';
|
|
49
|
+
if (type === 'news') {
|
|
50
|
+
info = '资讯';
|
|
51
|
+
} else if (type === 'column') {
|
|
52
|
+
info = '专栏';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ctx.state.data = {
|
|
56
|
+
title: `月幕 Galgame - ${info}`,
|
|
57
|
+
link: `${host}/co/article`,
|
|
58
|
+
description: `月幕 Galgame - ${info}`,
|
|
59
|
+
item: items,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { art } = require('@/utils/render');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const cheerio = require('cheerio');
|
|
5
|
+
|
|
6
|
+
const host = 'https://www.ymgal.games';
|
|
7
|
+
|
|
8
|
+
const date = new Date();
|
|
9
|
+
const year = date.getFullYear();
|
|
10
|
+
const month = date.getMonth() + 1;
|
|
11
|
+
|
|
12
|
+
module.exports = async (ctx) => {
|
|
13
|
+
const response = await got({
|
|
14
|
+
method: 'get',
|
|
15
|
+
url: `${host}/release-list/${year}/${month}`,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const $ = cheerio.load(response.data);
|
|
19
|
+
const list = $('.game-view-card').toArray();
|
|
20
|
+
|
|
21
|
+
const items =
|
|
22
|
+
list &&
|
|
23
|
+
list.map((item) => {
|
|
24
|
+
item = $(item);
|
|
25
|
+
const itemPicUrl = item.find('.lazy').first().attr('data-original');
|
|
26
|
+
const tags = item.find('.tag-info-list').children();
|
|
27
|
+
const taginfo = tags.map((i, elem) => $(elem).text()).get();
|
|
28
|
+
return {
|
|
29
|
+
title: item.attr('title'),
|
|
30
|
+
link: `${host}${item.attr('href')}`,
|
|
31
|
+
description: art(path.join(__dirname, 'templates/description.art'), { itemPicUrl, taginfo }),
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
ctx.state.data = {
|
|
36
|
+
title: `月幕 Galgame - 本月新作`,
|
|
37
|
+
link: `${host}/release-list/${year}/${month}`,
|
|
38
|
+
description: '月幕 Galgame - 本月新作',
|
|
39
|
+
item: items,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'ymgal.games': {
|
|
3
|
+
_name: '月幕 Galgame',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '全部文章',
|
|
7
|
+
docs: 'https://docs.rsshub.app/anime.html#yue-mu-galgame',
|
|
8
|
+
source: ['/co/article'],
|
|
9
|
+
target: '/ymgal/article/all',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '资讯',
|
|
13
|
+
docs: 'https://docs.rsshub.app/anime.html#yue-mu-galgame',
|
|
14
|
+
source: ['/co/article'],
|
|
15
|
+
target: '/ymgal/article/news',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '专栏',
|
|
19
|
+
docs: 'https://docs.rsshub.app/anime.html#yue-mu-galgame',
|
|
20
|
+
source: ['/co/article'],
|
|
21
|
+
target: '/ymgal/article/column',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: '本月新作',
|
|
25
|
+
docs: 'https://docs.rsshub.app/anime.html#yue-mu-galgame',
|
|
26
|
+
source: ['/'],
|
|
27
|
+
target: '/ymgal/game/release',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
};
|