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/$%7Bart_info.art.src%7D?q=fetch&page=707&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 8384 results for "fetch"(1800ms)

twemojimain.tsx2 matches

@stevedylandev•Updated 1 year ago
70
71 if (typeof api === "function") {
72 return (emojiCache[key] = fetch(api(code)).then(async r => r.text()));
73 }
74 return (emojiCache[key] = fetch(`${api}${code.toUpperCase()}.svg`).then(async r =>
75 r.text()));
76}

getWeathermain.tsx2 matches

@chet•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
10 const q = encodeURIComponent(query);
11 const apiUrl = `https://api.weatherapi.com/v1/forecast.json?key=${weatherApiKey}&q=${q}&days=${days}`;
12 const response = await fetch(apiUrl);
13 const data: any = await response.json();
14 return data;

greenhouseToRSSmain.tsx2 matches

@donmccurdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function greenhouseToRSS(req: Request) {
7 const mode = searchParams.get("mode");
8 const SOURCE_URL = `https://boards-api.greenhouse.io/v1/boards/${account}/jobs`;
9 const { jobs: sourceJobs } = await fetch(SOURCE_URL).then((res) => res.json());
10
11 const getFeedLink = (mode) => `https://donmccurdy-greenhousetorss.express.val.run/?account=${account}&mode=${mode}`;

leverToRSSmain.tsx2 matches

@donmccurdy•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function leverToRSS(req: Request) {
9 const SOURCE_URL = `https://api.lever.co/v0/postings/${account}?mode=xml`;
10 const parser = new XMLParser();
11 const sourceXML = await fetch(SOURCE_URL).then((res) => res.text());
12
13 const { job: sourceJobs } = parser.parse(sourceXML).jobs || { job: [] };

createValmain.tsx2 matches

@neverstew•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface ValResponse {
39 };
40
41 return fetchJSON("https://api.val.town/v1/vals", {
42 headers: {
43 Authorization: `Bearer ${token}`,

updateValByIDmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface UpdateValArgs {
20 };
21
22 return fetchJSON(`https://api.val.town/v1/vals/${valId}`, {
23 headers: {
24 Authorization: `Bearer ${token}`,

updateValByNamemain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface UpdateValArgs {
14 };
15
16 return fetchJSON("https://api.val.town/v1/vals", {
17 headers: {
18 Authorization: `Bearer ${token}`,

spotifymain.tsx1 match

@stevekrouse•Updated 1 year ago
99});
100
101export default app.fetch;

spotifyRefreshTokenmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2import { querystring } from "https://esm.town/v/stevekrouse/querystring";
3
4export let spotifyRefreshToken = async ({ refresh_token, client_id, client_secret }) =>
5 fetchJSON("https://accounts.spotify.com/api/token", {
6 method: "POST",
7 body: await querystring({

constructReadTangleUrlmain.tsx1 match

@willthereader•Updated 1 year ago
2
3// Immediately invoked function that exports a function generating a URL as a string,
4// which fetches all comments from an article associated with the provided post_id.
5export const constructReadTangleUrl = (() => {
6 return (post_id) => {

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago