Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

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

at a876aae44ea07494ebea9727350aa060b81f317b 27 lines 723 B view raw
1import {logger} from '#/logger' 2 3export async function resolveShortLink(shortLink: string) { 4 const controller = new AbortController() 5 const to = setTimeout(() => controller.abort(), 2e3) 6 7 try { 8 const res = await fetch(shortLink, { 9 method: 'GET', 10 headers: { 11 Accept: 'application/json', 12 }, 13 signal: controller.signal, 14 }) 15 if (res.status !== 200) { 16 logger.error('Failed to resolve short link', {status: res.status}) 17 return shortLink 18 } 19 const json = (await res.json()) as {url: string} 20 return json.url 21 } catch (e: unknown) { 22 logger.error('Failed to resolve short link', {safeMessage: e}) 23 return shortLink 24 } finally { 25 clearTimeout(to) 26 } 27}