1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getDuckDB = (async () => {
4 async function createWorker(url: string) {
5 const workerScript = await fetch(url);
6 const workerURL = URL.createObjectURL(await workerScript.blob());
7 return new Worker(workerURL, { type: "module" });
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// Github profile
4export let githubUser = fetchJSON(
5 "https://api.github.com/users/stevekrouse"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let eval_ = (code, args?) =>
4 fetchJSON("https://api.val.town/v1/eval", {
5 method: "POST",
6 body: JSON.stringify({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function discordMessages({ botToken, channelId }) {
4 return fetchJSON(
5 `https://discord.com/api/channels/${channelId}/messages`,
6 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let hnSearchByDate = (params) => fetchJSON(
4 `http://hn.algolia.com/api/v1/search_by_date?${new URLSearchParams(params)}`
5)
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let arenaApiExample = (async () => {
4 const resp = await fetch(
5 "http://api.are.na/v2/channels/that-glassy-dark-design-style",
6 );
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let runGET = fetchJSON(
4 `https://api.val.town/v1/run/stevekrouse.add?args=${JSON.stringify([1, 2])}`,
5);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleVal = (async () => {
4 const response = await fetch(
5 `https://api.val.town/v1/alias/tmcw/valTownApiExampleVal`,
6 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let evaluationFromValExample = (async () => {
4 const response = await fetch(`https://api.val.town/v1/eval`, {
5 method: "post",
6 body: JSON.stringify({ code: "1 + 1" }),
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let twitterJSON = ({url, bearerToken}) => fetchJSON(
4 url,
5 {headers: {authorization: `Bearer ${bearerToken}`}}