Skip to content

Commit

Permalink
feat: update bookwalkertw (DIYgod#7657)
Browse files Browse the repository at this point in the history
  • Loading branch information
wushijishan authored Jun 6, 2021
1 parent 2917652 commit 06f97c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/routes/bookwalkertw/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://www.bookwalker.com.tw/more/index/1',
url: 'https://www.bookwalker.com.tw/search?order=sell_desc&series_display=1&d=1',
});

const data = response.data;
Expand All @@ -14,13 +14,13 @@ module.exports = async (ctx) => {
let bookid;
ctx.state.data = {
title: 'BOOKWALKERTW热门新书',
link: 'https://www.bookwalker.com.tw/more/index/1',
link: 'https://www.bookwalker.com.tw/search?order=sell_desc&series_display=1&d=1',
item:
list &&
list
.map((index, item) => {
item = $(item);
bookid = item.find('a').attr('href').split('/')[4];
bookid = item.find('img').attr('data-src').split('/')[5];
return {
title: item.find('.bookname').text(),
description: `${item.find('.booknamesub').text()}&nbsp;|&nbsp;${item.find('.bprice').text()}<br><img src="https://image.bookwalker.com.tw/upload/product/${bookid}/zoom_big_${bookid}.jpg">`,
Expand Down

0 comments on commit 06f97c9

Please sign in to comment.