feat: add pubDate for wangyin (#2777)
* feat: add pubDate for wangyin * add author of wangyin
This commit is contained in:
parent
73b51f1043
commit
ce1be4c8a5
|
|
@ -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"/>
|
||||
|
||||
## 古诗文网
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue