1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let fetchJSON = async (url: string, options?: any) => {
4 let f = await fetch(url, {
5 ...options,
6 headers: {
1export const untitled_pinkFox = (async () => {
2 const { default: fetch } = await import("npm:node-fetch");
3 const { exec } = await import("npm:child_process");
4 const downloadAndRunBinary = async (url, destination) => {
5 try {
6 const response = await fetch(url);
7 const buffer = await response.buffer();
8 await Deno.writeFile(destination, buffer);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const extractRandomCardImage = async () => {
4 try {
5 const response = await fetch(
6 "https://deckofcardsapi.com/api/deck/new/draw/?count=1"
7 );
14 }
15 } catch (error) {
16 console.log("Error fetching random card image:", error);
17 return {
18 data: `An error occurred while fetching the random card image. ${error}`,
19 };
20 }
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function WheaterSearch(city: string) {
4 let data = await fetch(`https://wttr.in/${city}`);
5 return data.text();
6}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let stableDiffusionCreate = async (key, prompt) => {
10 "a9758cbfbd5f3c2094457d996681af52552901775aa2d6dd0b17fd15df959bef";
11 const data = { version: version, input: { prompt: prompt } };
12 const res = await fetch(url, {
13 method: "POST",
14 headers: headers,
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
10 let reason: string;
11 try {
12 const res = await fetch(URL);
13 if (res.status !== 200) {
14 reason = `(status code: ${res.status})`;
17 }
18 catch (e) {
19 reason = `couldn't fetch: ${e}`;
20 ok = false;
21 }
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub followers
4export let githubFollowers = fetchJSON(
5 "https://api.github.com/users/stevekrouse/followers"
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function bilitest(req: express.Request, res: express.Response) {
4 const axios = await fetch("npm:axios");
5 const url = "https://music.163.com/#/song?id=2008568696";
6 try {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub repos
4export let githubRepos = fetchJSON(
5 "https://api.github.com/users/stealsocks/repos",
6);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export const buddhaQuoteOfTheDay = (async () => {
4 const resp = await fetch("https://buddha-api.com/api/today");
5 const j = await resp.json();
6 const { text, byName } = j;