INNER CODE UNIT · TypeScript

fetchFileContent

winstonkoh87/Athena-Public · supabase/functions/sync-athena/index.ts:71

async function fetchFileContent(url: string): Promise<string> {
  const response = await fetch(url, {
    headers: {
      Authorization: `Bearer ${GITHUB_TOKEN}`,
    },
  });

  if (!response.ok) {
    throw new Error(`Failed to fetch file: ${response.statusText}`);
  }

  return await response.text();
}

// Parse session filename
function parseSessionFilename(filename: string): { date: string; sessionNum: number } | null {
  const match = filename.match(/(\d{4}-\d{2}-\d{2})-session-(\d+)\.md/);
  if (match) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…