add comment
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user