fix: make xianyu notifications per-item with clickable links
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { buildItemLinks } from '../lib/links.mjs';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
@@ -76,7 +77,7 @@ function renderTask(task, limit) {
|
||||
for (const { item, score, flags } of items) {
|
||||
const price = item.detailPrice || item.price || '-';
|
||||
const loc = item.sellerLocation || '-';
|
||||
const href = item.href || item.url || '';
|
||||
const href = buildItemLinks(item).primaryUrl || item.href || item.url || '';
|
||||
lines.push(`### ${score}分|${item.title || '(无标题)'}`);
|
||||
lines.push(`- 价格:${price}`);
|
||||
lines.push(`- 地区/卖家:${loc}${item.sellerName ? ` / ${item.sellerName}` : ''}`);
|
||||
|
||||
Reference in New Issue
Block a user