haixunMaster/lib/search/query-builders.ts

24 lines
785 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** Brave 搜尋 Threads 貼文用 query */
export function buildBraveThreadsKeywordQuery(keyword: string): string {
const q = keyword.trim();
if (q.startsWith("@")) {
return `site:threads.com "${q}" OR site:www.threads.com "${q}"`;
}
return `site:threads.com "${q}" OR site:www.threads.com "${q}"`;
}
/** 負評問題型補充查詢high priority 品牌監控) */
export function buildBraveBrandMonitorQueries(brand: string): string[] {
const b = brand.trim();
if (!b) return [];
const templates = [
`"${b}" "問題"`,
`"${b}" "推薦"`,
`"${b}" "有人用過"`,
`"${b}" "好用嗎"`,
`"${b}" "雷"`,
`"${b}" "踩雷"`,
`"${b}" "不推"`,
];
return templates.map((t) => `site:threads.com ${t} OR site:www.threads.com ${t}`);
}