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=649&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 7882 results for "fetch"(824ms)

fetchTweetmain.tsx4 matches

@vladimyr•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function fetchTweet(url) {
4 const tweetId = url.match(/(\d{19})/)[1];
5 const token = getToken(tweetId);
8 tweetURL.searchParams.set("lang", "en");
9 tweetURL.searchParams.set("token", token);
10 const res = await fetch(tweetURL, {
11 redirect: "follow",
12 });
15}
16
17// @see: https://github.com/vercel/react-tweet/blob/a292ca7/packages/react-tweet/src/api/fetch-tweet.ts#L27-L31
18function getToken(id: string) {
19 return ((Number(id) / 1e15) * Math.PI)

fetchTweetREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: a0_forks/fetchTweet

putValReproductionCasemain.tsx2 matches

@liamdanielduffy•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3await fetchJSON("https://api.val.town/v1/vals", {
4 headers: {
5 Authorization: `Bearer ${Deno.env.get("valtown")}`,

ssr_routermain.tsx1 match

@pomdtr•Updated 1 year ago
7app.all("/greet/:name", hydrate("pomdtr/example_greet_component"));
8
9export default app.fetch;

blogREADME.md1 match

@postpostscript•Updated 1 year ago
16- [2024-04-09 - reactiveStateBlob: wrap blob state in a proxy to autosave it on changes](https://val.town/v/postpostscript/reactiveStateBlob)
17- [2024-04-24 - lock: lock that releases when it leaves the execution context](https://val.town/v/postpostscript/lock)
18- [2024-04-25 - fetchWorker: communicate with a worker over a fetch-like interface](https://val.town/v/postpostscript/fetchWorker)
19- [2024-01-06 - interruptibleChain: simple interface for pausing and resuming execution chains](https://val.town/v/postpostscript/interruptibleChain) (now at https://github.com/postpostscript/chain)
20- [2024-01-07 - expiringBlob: create-and-forget blobs using UUIDv7](https://val.town/v/postpostscript/expiringBlob)

aliasmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
9 if ("valName" in params && params.token)
10 headers.Authorization = `Bearer ${params.token}`;
11 return fetchJSON(url, { headers });
12}
13type UserParams = {

ssr_react_minimain.tsx1 match

@stevekrouse•Updated 1 year ago
22 const onData = onSubmit ? onSubmit(e) : () => 1;
23 const formData = new FormData(e.target as any);
24 const resp = await fetch("/", {
25 method: props.action ?? "POST",
26 body: formData,

blobertDatamain.tsx2 matches

@rvorias•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3const gist =
5
6export const queryParams = async (req: Request) => {
7 const data = await fetch(gist);
8 const jsonData = await data.json();
9

postRequestExamplemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1// make POST fetch to https://stevekrouse-parsePostBodyExample.web.val.run
2console.log(
3 await (await fetch("https://stevekrouse-parsePostBodyExample.web.val.run", {
4 method: "POST",
5 headers: {

googlePhotosMarketingRSSmain.tsx3 matches

@Glench•Updated 1 year ago
1import { dataToRSS } from "https://esm.town/v/Glench/dataToRSS";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4async function getOfficialRedditPosts() {
5 const resp = await fetch("https://www.reddit.com/r/googlephotos/.json");
6 if (!resp.ok) return [];
7 const json = await resp.json();
13}
14async function getGoogleSupportForumPosts() {
15 const resp = await fetch(
16 "https://support.google.com/photos/threads?hl=en&max_results=500",
17 );

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago