Skip to content

Commit

Permalink
fix: dwnews time & api (DIYgod#3997)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoilc authored Feb 17, 2020
1 parent 5944c47 commit 5e4ae2a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
24 changes: 12 additions & 12 deletions docs/government.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,18 @@ pageClass: routes

<Route author="Jeason0228" example="/gov/customs/list/paimai" path="/gov/customs/list/:gchannel" :paramsDesc="['支持paimai,fagui等2个频道']" />

## 中华人民共和国教育部

### 新闻

<Route author="Crawler995" example="/gov/moe/policy_anal" path="/gov/moe/:type" :paramsDesc="['分类名']">

| 政策解读 | 最新文件 | 公告公示 | 教育部简报 |
| :---------: | :---------: | :------: | :---------------: |
| policy_anal | newest_file | notice | edu_ministry_news |

</Route>

## 中华人民共和国商务部

### 政务公开
Expand All @@ -342,18 +354,6 @@ pageClass: routes

</Route>

## 中华人民共和国教育部

### 新闻

<Route author="Crawler995" example="/gov/moe/policy_anal" path="/gov/moe/:type" :paramsDesc="['分类名']">

| 政策解读 | 最新文件 | 公告公示 | 教育部简报 |
| :---------: | :---------: | :------: | :---------------: |
| policy_anal | newest_file | notice | edu_ministry_news |

</Route>

## 中华人民共和国外交部

### 发言人表态
Expand Down
6 changes: 3 additions & 3 deletions docs/traditional-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ Category 列表:

<Route author="HenryQW" example="/dwnews/yaowen/global" path="/dwnews/yaowen/:region?" :paramsDesc="['要闻地区,默认`全部`,可选地区如下']">

| 全部 | 国际 | 中国 | 香港 | 台湾 | 经济 |
| ------ | ------ | ----- | -------- | ------ | ------ |
| yaowen | global | china | hongkong | taiwan | jingji |
| 全部 | 国际 | 中国 | 香港 | 台湾 | 经济 | 视觉 |
| ------ | ------ | ----- | -------- | ------ | ------ | ------ |
| yaowen | global | china | hongkong | taiwan | jingji | shijue |

</Route>

Expand Down
2 changes: 1 addition & 1 deletion lib/routes/dwnews/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ProcessFeed = (data) => {
link: data.publishUrl,
author: data.authors[0].publishName,
description,
pubDate: new Date(data.publishTime).toUTCString(),
pubDate: new Date(data.publishTime * 1000).toUTCString(),
};
};

Expand Down
8 changes: 6 additions & 2 deletions lib/routes/dwnews/yaowen.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ module.exports = async (ctx) => {
title = `经济${title}`;
regionid = '10000123';
break;
default:
case 'shijue':
title = `视觉${title}`;
regionid = '10000153';
break;
default:
throw 'Unknown region';
}
host = `https://prod-site-api.dwnews.com/v2/feed/zone/${regionid}?offset=99999999994&bucketId=00000`;
link = `${link}/zone/${regionid}`;
} else {
host = `https://prod-site-api.dwnews.com/v2/feed/zone/0?offset=99999999994&bucketId=00000`;
host = 'https://prod-site-api.dwnews.com/v2/feed/home/?offset=9999999999&bucketId=00000';
}

const list = await got.get(host);
Expand Down

0 comments on commit 5e4ae2a

Please sign in to comment.