diff --git a/docs/shopping.md b/docs/shopping.md
index 4b0c03d71d..9691ea2f68 100644
--- a/docs/shopping.md
+++ b/docs/shopping.md
@@ -124,6 +124,10 @@ pageClass: routes
+### 关键词
+
+
+
## 淘宝众筹
### 众筹项目
diff --git a/lib/router.js b/lib/router.js
index c7dfd52978..2924f46e43 100644
--- a/lib/router.js
+++ b/lib/router.js
@@ -793,6 +793,7 @@ router.get('/parcel/hermesuk/:tracking', require('./routes/parcel/hermesuk'));
// 甩甩尾巴
router.get('/dgtle/trade/:typeId?', require('./routes/dgtle/trade'));
+router.get('/dgtle/trade/search/:keyword', require('./routes/dgtle/keyword'));
// 抽屉新热榜
router.get('/chouti/:subject?', require('./routes/chouti'));
diff --git a/lib/routes/dgtle/keyword.js b/lib/routes/dgtle/keyword.js
new file mode 100644
index 0000000000..b9ae87ec23
--- /dev/null
+++ b/lib/routes/dgtle/keyword.js
@@ -0,0 +1,74 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+
+module.exports = async (ctx) => {
+ const keyword = ctx.params.keyword;
+
+ const host = 'http://trade.dgtle.com';
+ const baseUrl = `${host}/dgtle_module.php?mod=trade&searchsort=1&PName=${keyword}`;
+ const res = await got({
+ method: 'get',
+ url: baseUrl,
+ });
+ const $ = cheerio.load(res.data);
+ const tradeList = $('.tradebox');
+
+ const resultItem = await Promise.all(
+ tradeList
+ .map(async (_, tradeItem) => {
+ const $tradeItem = $(tradeItem);
+
+ const url = `${host}${$tradeItem.find('.tradetitle a').attr('href')}`;
+ const item = {
+ title: $tradeItem.find('.tradetitle').attr('title'),
+ description: '',
+ link: url,
+ author: $tradeItem.find('.tradeuser').text(),
+ };
+
+ const key = `dgtle-trade: ${url}`;
+ const value = await ctx.cache.get(key);
+
+ if (value) {
+ item.description = value.description;
+ item.pubDate = value.pubDate;
+ } else {
+ const tradeDetail = await got({
+ method: 'get',
+ url: url,
+ });
+ const $ = cheerio.load(tradeDetail.data);
+ const pubDate = new Date(
+ $('.cr_date > em')
+ .last()
+ .text()
+ ).toUTCString();
+ let description = `
+ .attr('src')
+ .replace(/\?.+/g, '')})
`;
+
+ description += $tradeItem.find('.tradeprice').text();
+ description += $('#trade_info').html();
+ description += $('.pcb').html();
+
+ item.description = description;
+ item.pubDate = pubDate;
+ ctx.cache.set(key, {
+ pubDate,
+ description,
+ });
+ }
+
+ return Promise.resolve(item);
+ })
+ .get()
+ );
+
+ ctx.state.data = {
+ title: `甩甩尾巴 - ${keyword}`,
+ description: '纯净,安全的玩家闲置物品交易平台',
+ link: baseUrl,
+ item: resultItem,
+ };
+};