Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=fetch&page=297&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 3107 results for "fetch"(789ms)

notionValLinkTweetmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchTweet } from "https://esm.town/v/dpetrouk/fetchTweet?v=35";
2
3export let notionValLinkTweet =
4 (await fetchTweet(
5 "https://twitter.com/stevekrouse/status/1686075940076449792",
6 )).text;

pollVulkanRSSFeedBugmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
3
4export const pollVulkanRSSFeedBug = (async () => {
5 const githubProject = "https://github.com/KhronosGroup/Vulkan-Docs";
6 const response = await fetch(`${githubProject}/commits.atom`);
7 const feed =
8 (await parseXML(await response.text())).feed;

getDiscordMessagesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { discordFetch } from "https://esm.town/v/stevekrouse/discordFetch";
2
3export let getDiscordMessages = (token, channelId) => discordFetch(
4 token,
5 `channels/${channelId}/messages`,

fetchXMLmain.tsx3 matches

@stevekrouse•Updated 1 year ago
1import { parseXML } from "https://esm.town/v/stevekrouse/parseXML";
2import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL";
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
4
5export let fetchXML = (url: string) =>
6 fetchText(normalizeURL(url))
7 .then(parseXML);

runValmain.tsx2 matches

@std•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { API_URL } from "https://esm.town/v/std/API_URL";
3
4export function runVal(name, ...args) {
5 return fetch(`${API_URL}/v1/run/${name.replace("@", "")}`, {
6 method: "POST",
7 body: JSON.stringify({

valTownApiExampleSearchmain.tsx2 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let valTownApiExampleSearch = (async () => {
4 const query = new URLSearchParams({ query: "lodash", limit: "4" });
5 const response = await fetch(`https://api.val.town/v1/search/vals?${query}`);
6 const json = await response.json();
7 return json;

blocks_innermain.tsx3 matches

@tmcw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let blocks_inner = async (req, res) => {
4 const [_, user, id, ...file] = req.path.split("/");
5 const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) =>
6 r.json()
7 );
11 res.set("Content-Type", "application/javascript");
12 return res.send(
13 await fetch(gist.files[file.filter(Boolean).join("/")].raw_url).then(
14 (r) => r.text()
15 ),

vidmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export let vid = async (name) =>
4 (await fetchJSON(
5 `https://api.val.town/v1/alias/${name.replace(".", "/").replace("@", "")}`,
6 )).id;

nasaAPODmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// Returns NASA's Astronomy Picture of the Day (APOD)
4export const nasaAPOD = fetchJSON("cutt.ly/T7ksirK");
5// Forked from @iBrokeit.nasaAPOD

valTownBlogJSONmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3export async function valTownBlogJSON(): Promise<Blog[]> {
4 let { parse } = await import("npm:node-html-parser");
5 const text = await fetchText("https://blog.val.town");
6 return [
7 ...parse(text)

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago