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;
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// Predict the nationality of a name
4export let nameNationality = fetchJSON(
5 "https://api.nationalize.io/?name=staci"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export async function fetchTwitterUser({ id, accessToken, query = "" }: {
4 id: string;
5 accessToken: string;
16 };
17}> {
18 const res = await fetchJSON(
19 `https://api.twitter.com/2/users/${id}?${query}`,
20 {
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub gists
4export let githubGists = fetchJSON(
5 "https://api.github.com/users/stevekrouse/gists"
6);
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3// GitHub starred repos
4export let githubStarred = fetchJSON(
5 "https://api.github.com/users/stevekrouse/starred?per_page=10",
6);