增加:搜狗特色LOGO (#1047)

* 增加:有品-每日上新

* 修复 summary 字段错误

* 将 youpin 模块转移至 mi 目录下,并更新文档

* 增加:搜狗特色LOGO
This commit is contained in:
凉凉 2018-11-03 10:55:24 +08:00 committed by DIYgod
parent 86ca9ff8b5
commit 3fa57ec74d
3 changed files with 33 additions and 0 deletions

View File

@ -2178,6 +2178,10 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运
<route name="百度趣画" author="xyqfer" example="/baidu/doodles" path="/baidu/doodles"/>
### 搜狗
<route name="搜狗特色LOGO" author="xyqfer" example="/sogou/doodles" path="/sogou/doodles"/>
### 香港天文台
<route name="Current Weather Report" author="calpa" example="/hko/weather" path="/hko/weather"/>

View File

@ -738,6 +738,9 @@ router.get('/geekpark/breakingnews', require('./routes/geekpark/breakingnews'));
// 百度
router.get('/baidu/doodles', require('./routes/baidu/doodles'));
// 搜狗
router.get('/sogou/doodles', require('./routes/sogou/doodles'));
// 香港天文台
router.get('/hko/weather', require('./routes/hko/weather'));

26
routes/sogou/doodles.js Normal file
View File

@ -0,0 +1,26 @@
const axios = require('../../utils/axios');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'http://help.sogou.com/logo/doodle_logo_list.html',
});
const data = response.data.split(/\r\n/).slice(1);
ctx.state.data = {
title: '搜狗特色LOGO',
link: 'http://help.sogou.com/logo/',
item: data.map((item) => {
item = item.split(',');
return {
title: `${item[2]}-${item[5]}`,
description: `<img referrerpolicy="no-referrer" src="${item[4]}">`,
pubDate: new Date(item[5]).toUTCString(),
link: item[7],
guid: item[4],
};
}),
};
};