5wacky enough to buy their music instead of streaming it from some service.
6
7Because Bandcamp doesn't have an API, this hinges on you going to your purchases page, copying the purchases, and pasting it in. Thanks to
8the ability of [the system clipboard to contain HTML](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem), the same technology that makes
9copy-and-pasted text have unpredictable and annoying font and boldness choices also lets this parse and reformat that purchases page into something
10shareable.
169 }
170
171 // Existing API proxy logic
172 const { API_URL } = await import("https://esm.town/v/std/API_URL?v=5");
173 const { fetchJSON } = await import("https://esm.town/v/stevekrouse/fetchJSON");
174 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
175 const Authorization = req.headers.get("Authorization") as string;
176 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization } });
177 if (!meRes.ok) {
178 return new Response("Unauthorized", { status: 401 });
232 );
233
234 const socialDataURL = new URL("https://api.socialdata.tools/twitter/search");
235 socialDataURL.searchParams.set("query", query);
236 const socialDataResults = await fetchJSON(socialDataURL.toString(), {
237 bearer: Deno.env.get("SOCIAL_DATA_API_KEY"),
238 });
239
5Chart.register(...registerables);
6
7import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
8import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
9import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
132 // Existing social data proxy logic remains unchanged
133 const Authorization = req.headers.get("Authorization") as string;
134 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization } });
135 if (!meRes.ok) {
136 return new Response("Unauthorized", { status: 401 });
190 );
191
192 const socialDataURL = new URL("https://api.socialdata.tools/twitter/search");
193 socialDataURL.searchParams.set("query", query);
194 const socialDataResults = await fetchJSON(socialDataURL.toString(), {
195 bearer: Deno.env.get("SOCIAL_DATA_API_KEY"),
196 });
197
58 async function buscarDadosLoteria(numero = null) {
59 const url = numero
60 ? `https://servicebus2.caixa.gov.br/portaldeloterias/api/megasena/${numero}`
61 : "https://servicebus2.caixa.gov.br/portaldeloterias/api/megasena/";
62
63 try {
396 ...queryParams,
397 limit,
398 // Best effort does not seem to work so we do this format dance, generally the api
399 // layer validates iso date formats so we are somewhat insulated.
400 start: formatDate(typeof start === "string" ? new Date(start) : start),
101 <pre><code class="language-typescript">import { ValSession } from "${rawUrl}";
102
103// Generate a token from your valtown api key.
104const token = await ValSession.new(Deno.env.get("valtown"));
105
127});
128
129type valSessionApi = typeof routes;
130
131const client = hc<valSessionApi>(httpEndpoint);
132
133export class ValSession {
1import { AtpAgent } from "https://esm.sh/@atproto/api@0.13.15";
2
3export const agent = new AtpAgent({ service: "https://public.api.bsky.app/" });
12 <script>hljs.highlightAll();</script>
13 <style>
14 @import url('https://fonts.googleapis.com/css2?family=Kumbh+Sans:wght@900&family=Roboto+Mono:wght@400;700&display=swap');
15
16 * {
119import { Wide } from 'http://esm.town/v/maxm/wide';
120
121// Use your Val Town API Token to create a session
122const wide = new Wide(await ValSession.new(Deno.env.get("valtown")))
123
8import { Wide } from 'http://esm.town/v/maxm/wide';
9
10// Use your Val Town API Token to create a session
11const wide = new Wide(await ValSession.new(Deno.env.get("valtown")))
12
8import { Wide } from 'https://esm.town/v/maxm/wide';
9
10// Use your Val Town API Token to create a session
11const wide = new Wide(await ValSession.new(Deno.env.get("valtown")))
12