style: auto format
This commit is contained in:
parent
94dd2b5889
commit
37ab8afd59
|
|
@ -615,7 +615,7 @@ RSSHub 支持使用访问密钥 / 码,白名单和黑名单三种方式进行
|
|||
|
||||
- BUPT
|
||||
|
||||
- `BUPT_PORTAL_COOKIE`: 登录后获得的 Cookie 值, 获取方式
|
||||
- `BUPT_PORTAL_COOKIE`: 登录后获得的 Cookie 值,获取方式
|
||||
1. 打开<https://webapp.bupt.edu.cn/wap/login.html?redirect=https://>并登录
|
||||
2. 无视掉报错,并打开 <https://webapp.bupt.edu.cn/extensions/wap/news/list.html?p-1&type=xnxw>
|
||||
3. 打开控制台,刷新
|
||||
|
|
|
|||
|
|
@ -664,19 +664,19 @@ category 对应的关键词有
|
|||
|
||||
<Route author="melvinto" example="/nytimes/book/combined-print-and-e-book-nonfiction" path="/nytimes/book/:category?"/>
|
||||
|
||||
| Category | 中文 |
|
||||
| -------- | -------- |
|
||||
| combined-print-and-e-book-nonfiction | 非虚构类 - 综合 |
|
||||
| hardcover-nonfiction| 非虚构类 - 精装本 |
|
||||
| paperback-nonfiction| 非虚构类 - 平装本 |
|
||||
| advice-how-to-and-miscellaneous| 工具类 |
|
||||
| combined-print-and-e-book-fiction| 虚构类 - 综合 |
|
||||
| hardcover-fiction| 虚构类 - 精装本 |
|
||||
| trade-fiction-paperback| 虚构类 - 平装本 |
|
||||
| childrens-middle-grade-hardcover| 儿童 - 中年级 |
|
||||
| picture-books| 儿童 - 绘本 |
|
||||
| series-books| 儿童 - 系列图书 |
|
||||
| young-adult-hardcover| 青少年 |
|
||||
| Category | 中文 |
|
||||
| ------------------------------------ | ----------------- |
|
||||
| combined-print-and-e-book-nonfiction | 非虚构类 - 综合 |
|
||||
| hardcover-nonfiction | 非虚构类 - 精装本 |
|
||||
| paperback-nonfiction | 非虚构类 - 平装本 |
|
||||
| advice-how-to-and-miscellaneous | 工具类 |
|
||||
| combined-print-and-e-book-fiction | 虚构类 - 综合 |
|
||||
| hardcover-fiction | 虚构类 - 精装本 |
|
||||
| trade-fiction-paperback | 虚构类 - 平装本 |
|
||||
| childrens-middle-grade-hardcover | 儿童 - 中年级 |
|
||||
| picture-books | 儿童 - 绘本 |
|
||||
| series-books | 儿童 - 系列图书 |
|
||||
| young-adult-hardcover | 青少年 |
|
||||
|
||||
## 澎湃新闻
|
||||
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@ const got = require('@/utils/got');
|
|||
const cheerio = require('cheerio');
|
||||
|
||||
const categoryList = {
|
||||
"combined-print-and-e-book-nonfiction" : "非虚构类 - 综合",
|
||||
"hardcover-nonfiction": "非虚构类 - 精装本",
|
||||
"paperback-nonfiction": "非虚构类 - 平装本",
|
||||
"advice-how-to-and-miscellaneous": "工具类",
|
||||
"combined-print-and-e-book-fiction": "虚构类 - 综合",
|
||||
"hardcover-fiction": "虚构类 - 精装本",
|
||||
"trade-fiction-paperback": "虚构类 - 平装本",
|
||||
"childrens-middle-grade-hardcover": "儿童 - 中年级",
|
||||
"picture-books": "儿童 - 绘本",
|
||||
"series-books": "儿童 - 系列图书",
|
||||
"young-adult-hardcover": "青少年"
|
||||
'combined-print-and-e-book-nonfiction': '非虚构类 - 综合',
|
||||
'hardcover-nonfiction': '非虚构类 - 精装本',
|
||||
'paperback-nonfiction': '非虚构类 - 平装本',
|
||||
'advice-how-to-and-miscellaneous': '工具类',
|
||||
'combined-print-and-e-book-fiction': '虚构类 - 综合',
|
||||
'hardcover-fiction': '虚构类 - 精装本',
|
||||
'trade-fiction-paperback': '虚构类 - 平装本',
|
||||
'childrens-middle-grade-hardcover': '儿童 - 中年级',
|
||||
'picture-books': '儿童 - 绘本',
|
||||
'series-books': '儿童 - 系列图书',
|
||||
'young-adult-hardcover': '青少年',
|
||||
};
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const category = ctx.params.category || "combined-print-and-e-book-nonfiction";
|
||||
const category = ctx.params.category || 'combined-print-and-e-book-nonfiction';
|
||||
|
||||
const url = `https://www.nytimes.com/books/best-sellers/${category}`;
|
||||
|
||||
|
|
@ -43,11 +43,11 @@ module.exports = async (ctx) => {
|
|||
const $link = $item.find('ul[aria-label="Links to Book Retailers"]');
|
||||
const links = $link.find('a').toArray();
|
||||
|
||||
let primaryLink = links.length > 0 ? $(links[0]).attr('href') : "";
|
||||
let primaryLink = links.length > 0 ? $(links[0]).attr('href') : '';
|
||||
|
||||
for (const link of links) {
|
||||
const l = $(link);
|
||||
if (l.text() === "Amazon") {
|
||||
if (l.text() === 'Amazon') {
|
||||
primaryLink = l.attr('href');
|
||||
break;
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ module.exports = async (ctx) => {
|
|||
title: `${index + 1}: ${$name.text()}`,
|
||||
author,
|
||||
description: `<figure><img src="${imageLink}" alt="test"/><figcaption><span>${description}</span></figcaption></figure><br/>${firstInfo}<br/>Author: ${author}<br/>Publisher: ${publisher}`,
|
||||
link: primaryLink
|
||||
link: primaryLink,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
|
|
|||
Loading…
Reference in New Issue