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=666&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 8061 results for "fetch"(884ms)

emailAPImain.tsx1 match

@agmm•Updated 1 year ago
43});
44
45export default app.fetch;

postEvalmain.tsx7 matches

@vladimyr•Updated 1 year ago
1// import { fetchTweet } from "https://esm.town/v/dpetrouk/fetchTweet?v=35";
2import { eval_ } from "https://esm.town/v/stevekrouse/eval_";
3import { fetchPost as fetchBskyPost } from "https://esm.town/v/vladimyr/fetchBlueskyPost";
4import { fetchTweet } from "https://esm.town/v/vladimyr/fetchTweet";
5
6export default async function(req: Request): Promise<Response> {
14 let post, code, result;
15 try {
16 post = await fetchPost(`https://${query}`);
17 result = await postEval(post, [req]);
18 return result;
31}
32
33export async function fetchPost(url: string | URL) {
34 const postURL = new URL(url);
35 if (["x.com", "twitter.com"].includes(postURL.hostname)) {
36 const tweet = await fetchTweet(postURL.href);
37 return { text: tweet.text };
38 }
39 if (postURL.hostname === "bsky.app") {
40 const bskyPost = await fetchBskyPost(postURL);
41 return { text: bskyPost.record.text };
42 }

provideBlobmain.tsx1 match

@postpostscript•Updated 1 year ago
10 try {
11 log && console.log("provideBlob.poll attempt", url);
12 const res = await fetch(url, {
13 headers: {
14 "Content-Type": "application/octet-stream",

blobmanagermain.tsx1 match

@agmm•Updated 1 year ago
54});
55
56export default app.fetch;

youTubeCommentWatchermain.tsx5 matches

@mux•Updated 1 year ago
57
58 const allComments = [];
59 async function fetchComments(pageToken: string = ""): Promise<void> {
60 const url =
61 `https://www.googleapis.com/youtube/v3/commentThreads?key=${API_KEY}&textFormat=plainText&part=snippet&allThreadsRelatedToChannelId=${CHANNEL_ID}&pageToken=${pageToken}`;
62
63 const response = await fetch(url);
64 const data = await response.json();
65
85 }
86
87 // If there's a next page, fetch more comments recursively
88 if (data.nextPageToken) {
89 fetchComments(data.nextPageToken);
90 }
91 }
92
93 await fetchComments();
94
95 const newComments = await sqlite.execute({

sqliteExplorerAppmain.tsx1 match

@pomdtr•Updated 1 year ago
150});
151
152export default basicAuth(app.fetch);

basicDownDetectormain.tsx1 match

@agmm•Updated 1 year ago
4 const now = new Date();
5 const url = "https://agmm.xyz/";
6 const r = await fetch(url);
7
8 console.log("Response", r);

harpersmain.tsx1 match

@visnup•Updated 1 year ago
5 async function request(url) {
6 console.log(url);
7 const res = await fetch(url);
8 return load(await res.text());
9 }

fetchBlueskyPostREADME.md1 match

@vladimyr•Updated 1 year ago
1Migrated from folder: bluesky/fetchBlueskyPost

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)

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago