1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function wttrGetForecast({
7 const wttrLocation = encodeURIComponent(location);
8 const wttrLang = encodeURIComponent(languageCode);
9 const res = await fetch(
10 `https://wttr.in/${wttrLocation}?lang=${wttrLang}&format=j1`
11 );
14 const { LemmyHttp } = await import("npm:lemmy-js-client@0.18.1");
15 let client = new LemmyHttp(`https://${instance}`, {
16 fetchFunction: fetch,
17 });
18 const quote = unusedQuotes.pop();
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function dohRequestIpAddr(domain) {
4 let req = await fetch(`https://1.1.1.1/dns-query?name=${domain}`, {
5 headers: { "Accept": "application/dns-json" },
6 });
1import { fetchJSON } from "https://esm.town/v/swyx/fetchJSON";
2
3export let testcase1 = fetchJSON('https://api.val.town/eval/@stevekrouse.messages')
4
5// export state = () => {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Explore the Star Wars universe, from StarWarsAPI
4export let starWars = fetchJSON(
5 "https://swapi.dev/api/people/1/"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const artICGetRandom = (limit: number = 1) =>
4 fetchJSON("https://api.artic.edu/api/v1/search", {
5 method: "POST",
6 headers: {
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let curl = async (url: string, options?: RequestInit) => {
4 const response = await fetch(url, options);
5 const headers = Object.fromEntries(response.headers.entries());
6 const body = await response.text();
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// token_type = 'Bot' | 'Bearer'
4export let discordAPI = ({path, tokenType, token}) => fetchJSON(
5 `https://discord.com/api/${path}`,
6
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let discordFetch = (token, route) => fetchJSON(
4 `https://discord.com/api/${route}`,
5 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let testWebhook = fetchJSON("https://api.val.town/eval/@stevekrouse.webhook", {method: "POST"})