mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-24 12:15:32 +08:00
fix: 白鲸出海 (#6328)
This commit is contained in:
+24
-33
@@ -1,43 +1,34 @@
|
||||
const got = require('@/utils/got');
|
||||
const date = require('@/utils/date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'post',
|
||||
method: 'get',
|
||||
url: 'http://www.baijingapp.com/api/get_more_articles/',
|
||||
responseType: 'json',
|
||||
form: {
|
||||
deviceid: 'ios',
|
||||
page: 1,
|
||||
},
|
||||
});
|
||||
|
||||
const resList = response.data;
|
||||
const data = JSON.parse(response.data.substr(1, response.data.length - 1));
|
||||
|
||||
// json字符串转json对象
|
||||
const resListObj = new Function('return ' + resList)();
|
||||
|
||||
if (resListObj.state === 1) {
|
||||
const output = resListObj.data.list.map((item) => {
|
||||
const title = item.title;
|
||||
const link = 'https://www.baijingapp.com/article/' + item.id;
|
||||
const time = item.time;
|
||||
const author = item.user_name;
|
||||
const image = item.image;
|
||||
const single = {
|
||||
title,
|
||||
link,
|
||||
time,
|
||||
author,
|
||||
image,
|
||||
};
|
||||
|
||||
return single;
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `白鲸出海`,
|
||||
desription: '白鲸出海 - 泛互联网出海服务平台',
|
||||
item: output,
|
||||
const output = data.data.list.map((item) => {
|
||||
const title = item.title;
|
||||
const link = 'https://www.baijingapp.com/article/' + item.id;
|
||||
const pubDate = date(item.time.replace(' ', ''));
|
||||
const author = item.user_name;
|
||||
const description = `<img src="${item.image}">`;
|
||||
const single = {
|
||||
title,
|
||||
link,
|
||||
pubDate,
|
||||
author,
|
||||
description,
|
||||
};
|
||||
}
|
||||
|
||||
return single;
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `白鲸出海`,
|
||||
desription: '白鲸出海 - 泛互联网出海服务平台',
|
||||
item: output,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user