1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Public holidays in the US in 2023
4export let holidaysUS = fetchJSON(
5 "https://date.nager.at/api/v2/publicholidays/2023/US"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function pingHttp(url: string) {
4 try {
5 const res = await fetch(url);
6 return res.status === 200;
7 } catch {
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 { fetch } from "https://esm.town/v/std/fetch";
2
3export let register_discord_commands = async (
13 url += `commands`;
14 }
15 const response = await fetch(url, {
16 headers: {
17 "Content-Type": "application/json",
1import { searchParams } from "https://esm.town/v/stevekrouse/searchParams?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
3
4export function comments({ token, since, until, offset, limit, relationship }: {
33 };
34}> {
35 return fetchJSON(
36 "http://api.val.town/v1/me/comments?" +
37 searchParams({
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Reddit recent posts from /r/aww (cute animals)
4export let subredditExample = fetchJSON(
5 "https://www.reddit.com/r/aww/.json"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const headersExample = async (request: Request) => {
11 });
12 }
13 const response = await fetch(targetUrl);
14 console.log(response);
15 let headersObject = {};
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getDict = (await fetch("https://docs.google.com/spreadsheets/d/e/2PACX-1vSaIstzxO8d2J37TZjcFQfk4cN3unhuq_e-SD5L6pLvwSxrg-h836e8uIyWmuxjsG3LIbcxKLxO_8aZ/pub?output=csv")).text()
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let getChineseDictionaryAsCSV = (await fetch("https://docs.google.com/spreadsheets/d/e/2PACX-1vSaIstzxO8d2J37TZjcFQfk4cN3unhuq_e-SD5L6pLvwSxrg-h836e8uIyWmuxjsG3LIbcxKLxO_8aZ/pub?output=csv")).text()
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let denoImportEx = (async () => {
6 );
7 const url = "https://blog.samaltman.com/how-to-be-successful";
8 const res = await fetch(
9 "https://extractus.deno.dev/extract?apikey=rn0wbHos2e73W6ghQf705bdF&type=article&url=" +
10 url