Skip to content

Commit

Permalink
style: auto format
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 25, 2021
1 parent 94dd2b5 commit 37ab8af
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion docs/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. 打开控制台,刷新
Expand Down
26 changes: 13 additions & 13 deletions docs/traditional-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | 青少年 |

## 澎湃新闻

Expand Down
30 changes: 15 additions & 15 deletions lib/routes/nytimes/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Expand All @@ -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;
}
Expand All @@ -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();
Expand Down

0 comments on commit 37ab8af

Please sign in to comment.