add comment

This commit is contained in:
2026-01-15 23:26:34 +09:00
parent 9980e596ca
commit b79900bee7
9 changed files with 498 additions and 89 deletions

View File

@@ -190,6 +190,20 @@ const SERVICE_MAP: Record<string, { domain: string; icon?: string }> = {
'pub.leaflet': { domain: 'leaflet.pub' },
}
// Search Bluesky posts mentioning a URL
export async function searchPostsForUrl(url: string): Promise<any[]> {
try {
const res = await fetch(
`https://public.api.bsky.app/xrpc/app.bsky.feed.searchPosts?q=${encodeURIComponent(url)}&limit=20`
)
if (!res.ok) return []
const data = await res.json()
return data.posts || []
} catch {
return []
}
}
export function getServiceInfo(collection: string): { name: string; domain: string; favicon: string } | null {
// Try to find matching service prefix
for (const [prefix, info] of Object.entries(SERVICE_MAP)) {