INNER CODE UNIT · TypeScript

attemptBird

steipete/summarize · packages/core/src/content/link-preview/content/index.ts:178

  const attemptBird = async (): Promise<ExtractedLinkContent | null> => {
    if (!deps.readTweetWithBird || !twitterStatus) {
      return null;
    }

    deps.onProgress?.({ kind: "bird-start", url, client: null });
    try {
      const tweet = await deps.readTweetWithBird({ url, timeoutMs });
      const text = tweet?.text?.trim() ?? "";
      const tweetClient = tweet?.client === "xurl" ? "xurl" : "bird";
      if (text.length === 0) {
        deps.onProgress?.({
          kind: "bird-done",
          url,
          client: tweetClient,
          ok: false,
          textBytes: null,
        });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…