Feature/dev guduodata (#8502)
Co-authored-by: Tony <TonyRL@users.noreply.github.com>
This commit is contained in:
parent
bd500ce58b
commit
85caaa0dff
|
|
@ -869,3 +869,5 @@ pageClass: routes
|
|||
| 灵异事件 | 灵异图片 | 民间奇谈 |
|
||||
| ------------- | ------------ | ------------ |
|
||||
| lingyishijain | lingyitupian | minjianqitan |
|
||||
|
||||
</Route>
|
||||
|
|
|
|||
|
|
@ -505,12 +505,14 @@ pageClass: routes
|
|||
|
||||
#### 北京教育考试院
|
||||
|
||||
<Route author="gavin-k" example="/gov/beijing/bjeea/bjeeagg" path="/gov/beijing/bjeea/:type" :paramsDesc="['分类名']"/>
|
||||
<Route author="gavin-k" example="/gov/beijing/bjeea/bjeeagg" path="/gov/beijing/bjeea/:type" :paramsDesc="['分类名']">
|
||||
|
||||
| 通知公告 | 招考政策 | 自考快递 |
|
||||
| :------: | :------: | :------: |
|
||||
| bjeeagg | zkzc | zkkd |
|
||||
|
||||
</Route>
|
||||
|
||||
### 河北省退役军人事务厅
|
||||
|
||||
<Route author="SunShinenny" example="/gov/veterans/hebei/sxxx" path="/gov/veterans/hebei/:type" :paramsDesc="['分类名']">
|
||||
|
|
@ -588,7 +590,7 @@ pageClass: routes
|
|||
|
||||
### 领事馆重要通知
|
||||
|
||||
<Route author="HenryQW" example="/embassy/us/chicago" path="/embassy/:country/:city" :paramsDesc="['国家短代码, 见[支持国家列表](#支持国家列表)', '城市, 对应国家列表下的`领事馆城市列表`']" />
|
||||
<Route author="HenryQW" example="/embassy/us/chicago" path="/embassy/:country/:city" :paramsDesc="['国家短代码, 见[支持国家列表](#支持国家列表)', '城市, 对应国家列表下的`领事馆城市列表`']" >
|
||||
|
||||
### 支持国家列表
|
||||
|
||||
|
|
@ -699,6 +701,8 @@ pageClass: routes
|
|||
| 贝尔法斯特 | `/embassy/uk/belfast` |
|
||||
| 曼彻斯特 | `/embassy/uk/manchester` |
|
||||
|
||||
</Route>
|
||||
|
||||
## 中华人民共和国国家发展和改革委员会
|
||||
|
||||
### 新闻动态
|
||||
|
|
|
|||
|
|
@ -411,6 +411,14 @@ type 为 all 时,category 参数不支持 cost 和 free
|
|||
| ---- | ---- | ----- |
|
||||
| yi | zhu | shang |
|
||||
|
||||
</Route>
|
||||
|
||||
## 骨朵数据
|
||||
|
||||
### 日榜
|
||||
|
||||
<Route author="Gem1ni" example="/guduodata/daily" path="/guduodata/daily" />
|
||||
|
||||
## 光大银行
|
||||
|
||||
### 外汇牌价
|
||||
|
|
@ -1054,4 +1062,4 @@ type 为 all 时,category 参数不支持 cost 和 free
|
|||
| ---- | ---- |
|
||||
| ch | pt |
|
||||
|
||||
</Route>
|
||||
</Route>
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
};
|
||||
})
|
||||
)
|
||||
)
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/daily': ['Gem1ni'],
|
||||
};
|
||||
|
|
@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/daily', require('./daily'));
|
||||
};
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<table border="1" cellpadding="2" cellspacing="0">
|
||||
<thead>
|
||||
<th>排名</th>
|
||||
<th>剧名</th>
|
||||
<th>播放平台</th>
|
||||
<th>上映时间</th>
|
||||
<th>评论数</th>
|
||||
<th>百度指数</th>
|
||||
<th>豆瓣评分</th>
|
||||
<th>全网热度</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{each rows}}
|
||||
<tr>
|
||||
<td>{{$index + 1}}</td>
|
||||
<td>{{$value.name}}</td>
|
||||
<td>{{$value.platforms}}</td>
|
||||
<td>{{$value.release_date}}</td>
|
||||
<td>{{$value.comment || ''}}</td>
|
||||
<td>{{$value.baidu_index || ''}}</td>
|
||||
<td>{{$value.douban || ''}}</td>
|
||||
<td>{{$value.gdi}}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
Loading…
Reference in New Issue