]*class="result"/i).slice(1));
for (const block of blocks) {
const titleMatch = block.match(/
]*href="([^"]+)"[^>]*>([\s\S]*?)<\/a>/i);
if (!titleMatch) continue;
const url = titleMatch[1];
const title = titleMatch[2].replace(/<[^>]+>/g, '').trim();
- const snippetMatch = block.match(/class="res-desc[^"]*"[^>]*>([\s\S]*?)<\/p>/i)
- || block.match(/class="res-rich[^"]*"[^>]*>([\s\S]*?)<\/div>/i)
- || block.match(/class="res-summary[^"]*"[^>]*>([\s\S]*?)<\/p>/i)
- || block.match(/]*>([\s\S]*?)<\/dd>/i);
+ const snippetMatch =
+ block.match(/class="res-desc[^"]*"[^>]*>([\s\S]*?)<\/p>/i) ||
+ block.match(/class="res-rich[^"]*"[^>]*>([\s\S]*?)<\/div>/i) ||
+ block.match(/class="res-summary[^"]*"[^>]*>([\s\S]*?)<\/p>/i) ||
+ block.match(/]*>([\s\S]*?)<\/dd>/i);
const snippet = snippetMatch ? snippetMatch[1].replace(/<[^>]+>/g, '').trim() : '';
if (title && url && !url.includes('so.com')) {
results.push({ title, url, snippet, engine: '360搜索', weight: 75 });
@@ -192,7 +353,7 @@ async function checkReachability(urls: string[], concurrency = 5): Promise