1import { fetch } from "https://esm.town/v/std/fetch";
2
3/**
11}) {
12 const { collectionName, qdrantKey, qdrantUrl } = args;
13 const resp = await fetch(
14 `https://${qdrantUrl}/collections/${collectionName}`,
15 {
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
6 "https://dog.ceo/api/breed/chihuahua/images/random",
7 );
8 const dogApiResp = await fetch(dogAPIURL.href);
9 const { message } = await dogApiResp.json();
10 const res = await fetch(process.env.BROOKLAND_SLACK_WEBHOOK_URL, {
11 method: "POST",
12 body: JSON.stringify({
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const isMyWebsiteDown = async () => {
8 console.log("hi there");
9 try {
10 const res = await fetch(URL);
11 if (res.status !== 200) {
12 reason = `(status code: ${res.status})`;
15 }
16 catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function valToString(val: string) {
6 }
7 const [author, name] = val.split(".");
8 const resp = await fetch(`https://api.val.town/v1/alias/${author}/${name}`);
9 if (resp.status !== 200) {
10 throw new Error(resp.statusText);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// E.g. from a user's perspective (not the real execution time!)
8 for (let i = 0; i < count; i++) {
9 let start = Date.now();
10 await fetch("https://api.val.town/eval/(()=%3E1+1)()");
11 evalTimes.push(Date.now() - start);
12 }
23 for (let i = 0; i < count; i++) {
24 let start = Date.now();
25 await fetch("https://api.val.town/eval/@healeycodes.addOnes()");
26 userFuncTimes.push(Date.now() - start);
27 }
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Github following!
4export let githubFollowing = (() => {
5 throw new Error(`${fetchJSON.impl.toString()}`);
6 return fetchJSON(
7 "https://api.github.com/users/stevekrouse/following"
8 );
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let jsYAMLExample = (async () => {
4 // Import the YAML parser
5 const jsYaml = await import("npm:js-yaml");
6 // Fetch a YAML file
7 const yaml = await fetch(
8 "https://raw.githubusercontent.com/docker/engine/8955d8da8951695a98eb7e15bead19d402c6eb27/api/swagger.yaml",
9 ).then((r) => r.text());
10 // parse the fetched file
11 const obj = jsYaml.load(yaml);
12 // Return part of the file
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const trackIphoneTradein = async () => {
4 const cheerio = await import("npm:cheerio@1.0.0-rc.12");
5 const page = await fetch(
6 "https://www.apple.com/shop/browse/overlay/tradein_landing/iphone_values",
7 ).then((r) => r.text());
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const politelyinvinciblepointerHandleFormEx = (async () => {
4 let body = { args: [{ email: "example@example.com" }] };
5 const response =
6 (await fetch(
7 "https://api.val.town/v1/run/politelyinvinciblepointer.handleForm",
8 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let postWebhookTest1 = fetchJSON(
4 "https://stevekrouse-postWebhook1.express.val.run",
5 {