style: auto format
This commit is contained in:
parent
65b6f941e5
commit
c802e041a0
|
|
@ -8,16 +8,16 @@ module.exports = async (ctx) => {
|
|||
const response = await got(url);
|
||||
const $ = cheerio.load(response.data);
|
||||
const items = $('div .table-responsive tbody tr')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const td = item.find('td');
|
||||
return {
|
||||
title: `${td[2].children[0].data}|${td[3].children[0].data}|${td[4].children[0].data}|${td[5].children[0].data}|${td[6].children[0].data}`,
|
||||
link: url,
|
||||
pubDate: timezone(parseDate(`${td[1].children[0].data} ${td[1].children[2].data.slice(0, 8)}`, 'DD-MM-YY HH:mm:ss'), +7)
|
||||
};
|
||||
});
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const td = item.find('td');
|
||||
return {
|
||||
title: `${td[2].children[0].data}|${td[3].children[0].data}|${td[4].children[0].data}|${td[5].children[0].data}|${td[6].children[0].data}`,
|
||||
link: url,
|
||||
pubDate: timezone(parseDate(`${td[1].children[0].data} ${td[1].children[2].data.slice(0, 8)}`, 'DD-MM-YY HH:mm:ss'), +7),
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
|
|
|
|||
|
|
@ -6,22 +6,22 @@ module.exports = async (ctx) => {
|
|||
const response = await got(url);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('div .ms-slide')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const a = item.find('a');
|
||||
const img = item.find('img');
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const a = item.find('a');
|
||||
const img = item.find('img');
|
||||
|
||||
return {
|
||||
title: a.text(),
|
||||
link: `${url}/${a.attr('href')}`,
|
||||
itunes_item_image: img.attr('data-src')
|
||||
};
|
||||
});
|
||||
return {
|
||||
title: a.text(),
|
||||
link: `${url}/${a.attr('href')}`,
|
||||
itunes_item_image: img.attr('data-src'),
|
||||
};
|
||||
});
|
||||
|
||||
const items = await Promise.all(
|
||||
list.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async() => {
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const response = await got(item.link);
|
||||
const $ = cheerio.load(response.data);
|
||||
const p = $('div .blog-grid').find('p');
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ module.exports = {
|
|||
title: '最近的地震',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#BMKG-yin-ni-qi-xiang-qi-hou-he-di-qiu-wu-li-ju',
|
||||
source: ['/', '/gempabumi-terkini.html'],
|
||||
target: '/bmkg/earthquake'
|
||||
target: '/bmkg/earthquake',
|
||||
},
|
||||
{
|
||||
title: '新闻',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#BMKG-yin-ni-qi-xiang-qi-hou-he-di-qiu-wu-li-ju',
|
||||
source: ['/', '/berita'],
|
||||
target: '/bmkg/news'
|
||||
target: '/bmkg/news',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue