diff --git a/docs/bbs.md b/docs/bbs.md index 9fcb6efc8e9455..c069b9892a2935 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -869,3 +869,5 @@ pageClass: routes | 灵异事件 | 灵异图片 | 民间奇谈 | | ------------- | ------------ | ------------ | | lingyishijain | lingyitupian | minjianqitan | + + diff --git a/docs/government.md b/docs/government.md index 30fd1c689fc944..e408acdfe13402 100644 --- a/docs/government.md +++ b/docs/government.md @@ -475,12 +475,14 @@ pageClass: routes #### 北京教育考试院 - + | 通知公告 | 招考政策 | 自考快递 | | :------: | :------: | :------: | | bjeeagg | zkzc | zkkd | + + ### 河北省退役军人事务厅 @@ -558,7 +560,7 @@ pageClass: routes ### 领事馆重要通知 - + ### 支持国家列表 @@ -669,6 +671,8 @@ pageClass: routes | 贝尔法斯特 | `/embassy/uk/belfast` | | 曼彻斯特 | `/embassy/uk/manchester` | + + ## 中华人民共和国国家发展和改革委员会 ### 新闻动态 diff --git a/docs/other.md b/docs/other.md index ddc37a0945ae8c..9a4756e3d3a8a1 100644 --- a/docs/other.md +++ b/docs/other.md @@ -411,6 +411,14 @@ type 为 all 时,category 参数不支持 cost 和 free | ---- | ---- | ----- | | yi | zhu | shang | + + +## 骨朵数据 + +### 日榜 + + + ## 光大银行 ### 外汇牌价 @@ -1054,4 +1062,4 @@ type 为 all 时,category 参数不支持 cost 和 free | ---- | ---- | | ch | pt | - + diff --git a/lib/v2/guduodata/daily.js b/lib/v2/guduodata/daily.js new file mode 100644 index 00000000000000..8ca5316bd620da --- /dev/null +++ b/lib/v2/guduodata/daily.js @@ -0,0 +1,63 @@ +const got = require('@/utils/got'); +const dayjs = require('dayjs'); +const { art } = require('@/utils/render'); +const path = require('path'); + +const host = 'http://data.guduodata.com'; + +const types = { + collect: { + name: '汇总榜', + categories: { + drama: '连续剧', + variety: '综艺' + } + }, + bill: { + name: '排行榜', + categories: { + network_drama: '网络剧', + network_movie: '网络大电影', + network_variety: '网络综艺', + tv_drama: '电视剧', + tv_variety: '电视综艺', + anime: '国漫' + } + } +}; + +module.exports = async (ctx) => { + const now = dayjs().valueOf(); + // yestoday + const yestoday = dayjs().subtract(1, 'day').format('YYYY-MM-DD'); + const renderRows = (rows) => art(path.join(__dirname, './templates/daily.art'), { rows }); + const items = Object.keys(types).flatMap((key) => + Object.keys(types[key].categories).map((category) => ({ + type: key, + name: `[${yestoday}] ${types[key].name} - ${types[key].categories[category]}`, + category: category.toUpperCase(), + url: `${host}/show/datalist?type=DAILY&category=${category.toUpperCase()}&date=${yestoday}` + })) + ); + ctx.state.data = { + title: `骨朵数据 - 日榜`, + link: host, + description: yestoday, + item: await Promise.all( + items.map((item) => ctx.cache.tryGet(item.url, + async () => { + const response = await got.get(`${item.url}&t=${now}`, { + headers: { Referer: `http://data.guduodata.com/`, }, + }); + const data = response.data.data; + return { + title: item.name, + pubDate: yestoday, + link: item.url, + description: renderRows(data), + }; + }) + ) + ) + }; +}; \ No newline at end of file diff --git a/lib/v2/guduodata/maintainer.js b/lib/v2/guduodata/maintainer.js new file mode 100644 index 00000000000000..4e22b0a06bc372 --- /dev/null +++ b/lib/v2/guduodata/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/daily': ['Gem1ni'], +}; diff --git a/lib/v2/guduodata/radar.js b/lib/v2/guduodata/radar.js new file mode 100644 index 00000000000000..cca5338845617f --- /dev/null +++ b/lib/v2/guduodata/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'guduodata.com': { + _name: '骨朵数据', + data: [ + { + title: '日榜', + docs: 'https://docs.rsshub.app/other.html#gu-duo-shu-ju', + source: ['/'], + target: '/guduodata/daily', + }, + ], + }, +}; diff --git a/lib/v2/guduodata/router.js b/lib/v2/guduodata/router.js new file mode 100644 index 00000000000000..06e88767cd0cc8 --- /dev/null +++ b/lib/v2/guduodata/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/daily', require('./daily')); +}; diff --git a/lib/v2/guduodata/templates/daily.art b/lib/v2/guduodata/templates/daily.art new file mode 100644 index 00000000000000..0c77f57a3f6a8d --- /dev/null +++ b/lib/v2/guduodata/templates/daily.art @@ -0,0 +1,26 @@ + + + + + + + + + + + + + {{each rows}} + + + + + + + + + + + {{/each}} + +
排名剧名播放平台上映时间评论数百度指数豆瓣评分全网热度
{{$index + 1}}{{$value.name}}{{$value.platforms}}{{$value.release_date}}{{$value.comment || ''}}{{$value.baidu_index || ''}}{{$value.douban || ''}}{{$value.gdi}}
\ No newline at end of file