feat: 新增快手热榜及网易新闻

This commit is contained in:
imsyy
2023-07-17 17:05:09 +08:00
parent 8cffc6c701
commit c42573c37c
22 changed files with 405 additions and 12 deletions

View File

@@ -1,10 +1,12 @@
const Router = require("koa-router");
const wereadRouter = new Router();
const axios = require("axios");
const getWereadID = require("../utils/getWereadID");
const { get, set, del } = require("../utils/cacheData");
// 接口信息
const routerInfo = {
name: "weread",
title: "微信读书",
subtitle: "飙升榜",
};
@@ -23,7 +25,6 @@ const getData = (data) => {
if (!data) return [];
return data.map((v) => {
const book = v.bookInfo;
console.log(book);
return {
id: book.bookId,
title: book.title,
@@ -31,8 +32,10 @@ const getData = (data) => {
pic: book.cover.replace("s_", "t9_"),
hot: v.readingCount,
author: book.author,
url: "https://weread.qq.com/web/category/rising",
mobileUrl: "https://weread.qq.com/web/category/rising",
url: `https://weread.qq.com/web/bookDetail/${getWereadID(book.bookId)}`,
mobileUrl: `https://weread.qq.com/web/bookDetail/${getWereadID(
book.bookId
)}`,
};
});
};