feat: hotukdeals hottest

This commit is contained in:
DIYgod
2023-01-04 21:02:44 +00:00
parent 728da7f154
commit a090507de4
6 changed files with 41 additions and 0 deletions
+4
View File
@@ -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
+4
View File
@@ -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
### 订阅价格
+25
View File
@@ -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
View File
@@ -1,3 +1,4 @@
module.exports = {
'/:type': ['DIYgod'],
'/hottest': ['DIYgod'],
};
+6
View File
@@ -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
View File
@@ -1,3 +1,4 @@
module.exports = function (router) {
router.get('/hottest', require('./hottest'));
router.get('/:type', require('./index'));
};