feat: hotukdeals hottest
This commit is contained in:
@@ -77,6 +77,10 @@ Parameter `time` only works when `mostwanted` is chosen as the category.
|
||||
|
||||
<RouteEn author="DIYgod" example="/hotukdeals/hot" path="/hotukdeals/:type" :paramsDesc="['should be one of highlights, hot, new, discussed']"/>
|
||||
|
||||
### hottest
|
||||
|
||||
<RouteEn author="DIYgod" example="/hotukdeals/hottest" path="/hotukdeals/hottest"></RouteEn>
|
||||
|
||||
## IKEA
|
||||
|
||||
### UK - New Product Release
|
||||
|
||||
@@ -91,6 +91,10 @@ pageClass: routes
|
||||
|
||||
<Route author="DIYgod" example="/hotukdeals/hot" path="/hotukdeals/:type" :paramsDesc="['should be one of highlights, hot, new, discussed']" ></Route>
|
||||
|
||||
### hottest
|
||||
|
||||
<Route author="DIYgod" example="/hotukdeals/hottest" path="/hotukdeals/hottest"></Route>
|
||||
|
||||
## lativ
|
||||
|
||||
### 订阅价格
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
const got = require('@/utils/got');
|
||||
const { JSDOM } = require('jsdom');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const data = await got.get(`https://www.hotukdeals.com/`, {
|
||||
headers: {
|
||||
Referer: `https://www.hotukdeals.com/`,
|
||||
},
|
||||
});
|
||||
|
||||
const dom = new JSDOM(data.data, {
|
||||
runScripts: 'dangerously',
|
||||
});
|
||||
const threads = dom.window.__INITIAL_STATE__.widgets.hottestWidget.threads;
|
||||
|
||||
ctx.state.data = {
|
||||
title: `hotukdeals hottest`,
|
||||
link: `https://www.hotukdeals.com/`,
|
||||
item: threads.map((item) => ({
|
||||
title: item.title,
|
||||
description: `<img src="https://images.hotukdeals.com/${item.mainImage.path}/${item.mainImage.name}/re/768x768/qt/60/${item.mainImage.name}.jpg"><br>${item.temperature}° ${item.title}<br>${item.displayPrice}`,
|
||||
link: item.url,
|
||||
})),
|
||||
};
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
module.exports = {
|
||||
'/:type': ['DIYgod'],
|
||||
'/hottest': ['DIYgod'],
|
||||
};
|
||||
|
||||
@@ -26,6 +26,12 @@ module.exports = {
|
||||
source: ['/'],
|
||||
target: '/hotukdeals/discussed',
|
||||
},
|
||||
{
|
||||
title: 'hottest',
|
||||
docs: 'https://docs.rsshub.app/shopping.html#hotukdeals',
|
||||
source: ['/'],
|
||||
target: '/hotukdeals/hottest',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/hottest', require('./hottest'));
|
||||
router.get('/:type', require('./index'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user