feat: add pubDate for wangyin (#2777)

* feat: add pubDate for wangyin

* add author of wangyin
This commit is contained in:
四季天书SkiTiSu 2019-08-08 21:30:31 +08:00 committed by DIYgod
parent 73b51f1043
commit ce1be4c8a5
2 changed files with 4 additions and 1 deletions

View File

@ -519,7 +519,7 @@ type 为 all 时category 参数不支持 cost 和 free
### 王垠-当然我在扯淡
<Route author="junbaor" example="/blogs/wangyin" path="/blogs/wangyin"/>
<Route author="junbaor SkiTiSu" example="/blogs/wangyin" path="/blogs/wangyin"/>
## 古诗文网

View File

@ -1,3 +1,4 @@
const date = require('@/utils/date');
const got = require('@/utils/got');
const cheerio = require('cheerio');
@ -11,12 +12,14 @@ module.exports = async (ctx) => {
const element = $(e);
const title = element.find('a').text();
const link = url + element.find('a').attr('href');
const dateraw = /(\d+)\/(\d+)\/(\d+)/.exec(link);
return {
title: title,
description: '',
link: link,
author: '王垠',
pubDate: date(`${dateraw[1]}-${dateraw[2]}-${dateraw[3]}`),
};
})
.get();