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=554&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 8300 results for "fetch"(1242ms)

slackbotmain.tsx3 matches

@begoon•Updated 7 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3const { env } = Deno;
8
9async function message(channel: string, text: string, thread_ts?: string) {
10 return await fetchJSON(
11 "https://slack.com/api/chat.postMessage",
12 {
19
20async function reaction(channel: string, timestamp: string, name: string = "thumbsup") {
21 return await fetchJSON(
22 "https://slack.com/api/reactions.add",
23 {

slackScoutmain.tsx8 matches

@fahadakhan2•Updated 7 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
60// async 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" },

oldPersonalWebsitemain.tsx1 match

@willthereader•Updated 7 months ago
37app.get("/projects/Debugging_Guide", Debugging_Guide);
38
39export default app.fetch;

cleverJadePlanarianmain.tsx1 match

@stevekrouse•Updated 7 months ago
37app.get("/projects/Debugging_Guide", Debugging_Guide);
38
39export default app.fetch;

Debugging_Guidemain.tsx1 match

@stevekrouse•Updated 7 months ago
74const app = new Hono();
75app.get("/", Debugging_Guide);
76export default app.fetch;

rssViewermain.tsx3 matches

@easrng•Updated 7 months ago
29 url: string;
30}
31const extract = async (url, options = {}, fetchOptions = {}) => {
32 const retrieve_default = async (url, options: any = {}) => {
33 const {
36 },
37 } = options;
38 const res = await fetch(url, { headers, redirect: "follow" });
39 const status = res.status;
40 if (status >= 400) {
57 throw new Error(`Invalid content type: ${contentType}`);
58 };
59 const data = await retrieve_default(url, fetchOptions);
60 if (!data.text && !data.json) {
61 throw new Error(`Failed to load content from "${url}"`);

setTidbytImagemain.tsx2 matches

@andreterron•Updated 7 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import process from "node:process";
3
12 const apiKey = Deno.env.get("tidbyt_apikey");
13 for (let { apiKey, id } of devices) {
14 const res = await fetch(
15 `https://api.tidbyt.com/v0/devices/${id}/push`,
16 {

scientificCyanHarriermain.tsx13 matches

@stevekrouse•Updated 7 months ago
17
18 useEffect(() => {
19 fetchTables();
20 }, []);
21
22 const fetchTables = async () => {
23 try {
24 const response = await fetch("/tables");
25 const data = await response.json();
26 setTables(data);
27 } catch (err) {
28 setError("Failed to fetch tables");
29 }
30 };
31
32 const fetchTableData = async (tableName, pageNumber = 1) => {
33 try {
34 const response = await fetch(`/tableData/${tableName}?page=${pageNumber}&pageSize=${pageSize}`);
35 const { data, schema, totalRows } = await response.json();
36 setTableData(data);
47 setNewRow(emptyRow);
48 } catch (err) {
49 setError(`Failed to fetch data for table ${tableName}`);
50 }
51 };
57 const handleSave = async (index) => {
58 try {
59 const response = await fetch(`/update/${selectedTable}`, {
60 method: "POST",
61 headers: {
68 }
69 setEditingRow(null);
70 await fetchTableData(selectedTable, page);
71 } catch (err) {
72 setError(`Failed to update row: ${err.message}`);
86 const handleAddRow = async () => {
87 try {
88 const response = await fetch(`/insert/${selectedTable}`, {
89 method: "POST",
90 headers: {
96 throw new Error("Failed to add new row");
97 }
98 await fetchTableData(selectedTable, totalPages); // Go to the last page where the new row might be added
99 // Reset newRow to empty values
100 const emptyRow = Object.keys(newRow).reduce((acc, key) => {
109
110 const handlePageChange = (newPage) => {
111 fetchTableData(selectedTable, newPage);
112 };
113
120 <li
121 key={table}
122 onClick={() => fetchTableData(table)}
123 className={selectedTable === table ? "active" : ""}
124 >

patchedFeedExtractormain.tsx4 matches

@easrng•Updated 7 months ago
92};
93
94// ../esmd/npm/@extractus/feed-extractor@7.1.3/node_modules/.pnpm/@extractus+feed-extractor@7.1.3/node_modules/@extractus/feed-extractor/src/deno/cross-fetch.js
95var cross_fetch_default = fetch;
96
97// ../esmd/npm/@extractus/feed-extractor@7.1.3/node_modules/.pnpm/@extractus+feed-extractor@7.1.3/node_modules/@extractus/feed-extractor/src/utils/retrieve.js
98var profetch = async (url, options = {}) => {
99 const { proxy = {}, signal = null } = options;
100 const {
102 headers = {},
103 } = proxy;
104 const res = await cross_fetch_default(target + encodeURIComponent(url), {
105 headers,
106 signal,

blob_adminmain.tsx2 matches

@ryi•Updated 7 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";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago