Mirror of
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: remove URL check, trust API

+2 -25
+2 -25
src/lib/events.ts
··· 27 27 return value; 28 28 } 29 29 30 - async function isUrlReachable(url: string): Promise<boolean> { 31 - try { 32 - const response = await fetch(url, { 33 - method: "HEAD", 34 - signal: AbortSignal.timeout(3000), 35 - }); 36 - return response.ok; 37 - } catch { 38 - return false; 39 - } 40 - } 41 - 42 30 function sanitizeBrand(text: string): string { 43 31 return text.replace(/npmx/gi, "npmx"); 44 32 } ··· 112 100 if (feedRes.ok) { 113 101 const { feed } = await feedRes.json(); 114 102 115 - const candidates = feed.reduce((acc: Event[], item: any) => { 103 + const posts = feed.reduce((acc: Event[], item: any) => { 116 104 const actionTimestamp = item.reason?.indexedAt || item.post.indexedAt; 117 105 const itemDate = new Date(actionTimestamp); 118 106 ··· 133 121 return acc; 134 122 }, []); 135 123 136 - const reachabilityResults = await Promise.all( 137 - candidates.map(async (c: Event) => ({ 138 - event: c, 139 - isAlive: c.url ? await isUrlReachable(c.url) : false, 140 - })), 141 - ); 142 - 143 - const aliveEvents = reachabilityResults 144 - .filter((r) => r.isAlive) 145 - .map((r) => r.event); 146 - 147 - events.push(...aliveEvents); 124 + events.push(...posts); 148 125 LOG.success(`Bluesky: Collected ${events.length} active items.`); 149 126 } 150 127 } catch {