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=537&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 8457 results for "fetch"(1089ms)

bsky_rss_pollmain.tsx2 matches

@stevekrouse•Updated 6 months ago
1import { rss_to_bsky } from "https://esm.town/v/jordan/rss_to_bsky";
2import { blob } from "https://esm.town/v/std/blob";
3import { fetch } from "https://esm.town/v/std/fetch";
4
5export async function bsky_rss_poll() {
6 const { parseFeed } = await import("https://deno.land/x/rss/mod.ts");
7 const res = await fetch("https://v8.dev/blog.atom")
8 .then(res => res.text())
9 .then(res => parseFeed(res));

slackScoutmain.tsx8 matches

@charlypoly•Updated 6 months ago
20 for (const topic of KEYWORDS) {
21 const results = await Promise.allSettled([
22 fetchHackerNewsResults(topic),
23 fetchTwitterResults(topic),
24 fetchRedditResults(topic),
25 ]);
26
49}
50
51// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53 return hackerNewsSearch({
54 query: topic,
58}
59
60async function fetchTwitterResults(topic: string): Promise<Website[]> {
61 return twitterSearch({
62 query: topic,
67}
68
69async function fetchRedditResults(topic: string): Promise<Website[]> {
70 return redditSearch({ query: topic });
71}
84 }
85
86 const response = await fetch(slackWebhookUrl, {
87 method: "POST",
88 headers: { "Content-Type": "application/json" },

openaimain.tsx1 match

@std•Updated 6 months ago
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.

reqEvaltownmain.tsx1 match

@vawogbemi•Updated 6 months ago
32 const url = new URL("." + pathname, "http://localhost:" + port);
33 url.search = search;
34 const resp = await fetch(url, {
35 method: req.method,
36 headers: req.headers,

valtowntownmain.tsx1 match

@vawogbemi•Updated 6 months ago
174});
175
176export default app.fetch.bind(app);
177
178const css = `

blob_adminmain.tsx2 matches

@pkf•Updated 6 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
154
155// Update the export statement
156export default modifyFetchHandler(app.fetch);

elegantJadeParrotfishmain.tsx4 matches

@temptemp•Updated 6 months ago
12
13async function archive(url: string) {
14 const response = await fetch(url);
15 const body = await response.text();
16 const $ = load(body);
51 <h3>DDL UTILITY v0.0.1b</h3>
52 <code>
53 This site fetches content from another site,if any links dosent work then the movie is probably not uploaded.
54 </code>
55 <input type="text" placeholder="IMDB ID" name="imdb" />
67 const url = new URL(atob(c.req.query("id")));
68 if ((url.hostname) !== "www.primewire.tf") throw new Error("Error...");
69 const req = await fetch(url, { method: "HEAD", redirect: "manual" });
70 const realURL = await req.headers.get("location");
71 const newURL = new URL(realURL);
344// getSourcesParams.append("h", kid);
345// getSourcesParams.append("b", browserid);
346// const result = await fetch(
347// `https://rabbitstream.net/ajax/v2/embed-4/getSources?${getSourcesParams.toString()}`,
348// {

verbalScarletAntelopemain.tsx12 matches

@vawogbemi•Updated 6 months ago
60 }, [state.loading, state.hasMore]);
61
62 const fetchStories = async () => {
63 try {
64 const response = await fetch("/api/stories");
65 if (!response.ok) throw new Error("Failed to fetch dates");
66 const data = await response.json();
67 setStories(data);
69 }
70 catch (err) {
71 console.error("Error fetching stories:", err);
72 }
73 };
74
75 const fetchComments = async (query: string, story: string, page: number) => {
76 try {
77 dispatch({ type: "loading", value: true });
78 const response = await fetch(`/api/comments?query=${encodeURIComponent(query)}&story=${story}&page=${page}`);
79 if (!response.ok) throw new Error("Failed to fetch comments");
80 const data = await response.json();
81 setComments(prevComments => page === 1 ? data.hits : [...prevComments, ...data.hits]);
84 dispatch({ type: "loading", value: false });
85 } catch (err) {
86 console.error("Error fetching comments:", err);
87 dispatch({ type: "loading", value: false });
88 }
99 dispatch({ type: "hasMore", value: true });
100 dispatch({ type: "query", value: newQuery });
101 fetchComments(fullQuery, state.story, 1);
102 };
103
104 useEffect(() => {
105 fetchStories();
106
107 const handleScroll = () => {
122 : "";
123 const fullQuery = `${filtersQuery} ${state.query}`;
124 fetchComments(fullQuery, state.story, state.page);
125 }
126 }
408 tags: `comment, story_${story}`,
409 page: 0,
410 hitsPerPage: 100, // Fetch a moderate number of comments
411 });
412

forbearingOrangePlatypusmain.tsx2 matches

@Felistan•Updated 6 months ago
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {

sqlitemain.tsx2 matches

@Felistan•Updated 6 months ago
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago