Skip to content

Instantly share code, notes, and snippets.

@nickytonline
Created November 13, 2022 01:35
Show Gist options
  • Select an option

  • Save nickytonline/102bb45e625db6b9ae0157e293cfb0a3 to your computer and use it in GitHub Desktop.

Select an option

Save nickytonline/102bb45e625db6b9ae0157e293cfb0a3 to your computer and use it in GitHub Desktop.

Revisions

  1. nickytonline created this gist Nov 13, 2022.
    14 changes: 14 additions & 0 deletions get-revue-newsletters.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    import "https://deno.land/x/dotenv/load.ts";

    const response = await fetch("https://www.getrevue.co/api/v2/issues", {
    headers: {
    Authorization: `Token ${Deno.env.get("REVUE_API_KEY")}`,
    },
    });

    const issues = await response.json();

    await Deno.writeFile(
    "./revue-newsletter-issues.json",
    new Uint8Array(new TextEncoder().encode(JSON.stringify(issues, null, 2)))
    );