INNER CODE UNIT · TypeScript
attemptTwitterSyndication
steipete/summarize · packages/core/src/content/link-preview/content/index.ts:284
const attemptTwitterSyndication = async (): Promise<ExtractedLinkContent | null> => {
const tweetId = extractTweetId(url);
if (!tweetId) return null;
const syndicationUrl = toTwitterSyndicationUrl(tweetId);
deps.onProgress?.({ kind: ProgressKind.TwitterSyndicationStart, url: syndicationUrl });
try {
const response = await deps.fetch(syndicationUrl, {
headers: {
"User-Agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
},
signal: AbortSignal.timeout(timeoutMs),
});
if (!response.ok) {
deps.onProgress?.({