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/image-url.jpg%20%22Image%20title%22?q=fetch&page=1082&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 13565 results for "fetch"(7602ms)

quotableApiProxymain.tsx2 matches

@johndturn•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export default async function proxy(req: Request) {
4 const resp = await fetch(
5 "http://api.quotable.io/quotes/random?limit=1",
6 );

telegrambotmain.tsx2 matches

@begoon•Updated 8 months ago
16async function POST(cmd: string, data: { [key: string]: string }) {
17 const url = BOT + "/" + cmd;
18 return await (await fetch(
19 url,
20 {
27
28async function GET(cmd: string) {
29 return await (await fetch(BOT + "/" + cmd)).json();
30}
31

upsetSilverLimpetmain.tsx8 matches

@danielchalef•Updated 8 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" },

wateryPeachEarwigmain.tsx8 matches

@danielchalef•Updated 8 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" },

slackScoutmain.tsx8 matches

@danielchalef•Updated 8 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" },

valWallmain.tsx3 matches

@stevekrouse•Updated 8 months ago
67 }
68
69 console.log(`Fetching contributions for ${username}`);
70 try {
71 let vals;
81 }
82
83 console.log(`Fetched ${vals.length} contributions`);
84 const contributionData = processVals(vals, useVersions);
85 console.log(`Processed ${contributionData.length} contributions`);
282}
283
284export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;

valWallmain.tsx3 matches

@stevekrouse•Updated 8 months ago
67 }
68
69 console.log(`Fetching contributions for ${username}`);
70 try {
71 let vals;
81 }
82
83 console.log(`Fetched ${vals.length} contributions`);
84 const contributionData = processVals(vals, useVersions);
85 console.log(`Processed ${contributionData.length} contributions`);
282}
283
284export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;

sqliteAdminDashboardmain.tsx13 matches

@stevekrouse•Updated 8 months ago
20
21 useEffect(() => {
22 fetchTables();
23 }, []);
24
25 const fetchTables = async () => {
26 try {
27 const response = await fetch("/tables");
28 const data = await response.json();
29 setTables(data);
30 } catch (err) {
31 setError("Failed to fetch tables");
32 }
33 };
34
35 const fetchTableData = async (tableName) => {
36 try {
37 const dataResponse = await fetch(`/table/${tableName}`);
38 const data = await dataResponse.json();
39 setTableData(data);
40
41 const schemaResponse = await fetch(`/schema/${tableName}`);
42 const schema = await schemaResponse.json();
43 setTableSchema(schema);
51 setNewRow(emptyRow);
52 } catch (err) {
53 setError(`Failed to fetch data for table ${tableName}`);
54 }
55 };
61 const handleSave = async (index) => {
62 try {
63 const response = await fetch(`/update/${selectedTable}`, {
64 method: "POST",
65 headers: {
72 }
73 setEditingRow(null);
74 await fetchTableData(selectedTable);
75 } catch (err) {
76 setError(`Failed to update row: ${err.message}`);
90 const handleAddRow = async () => {
91 try {
92 const response = await fetch(`/insert/${selectedTable}`, {
93 method: "POST",
94 headers: {
100 throw new Error("Failed to add new row");
101 }
102 await fetchTableData(selectedTable);
103 // Reset newRow to empty values
104 const emptyRow = Object.keys(newRow).reduce((acc, key) => {
120 <li
121 key={table}
122 onClick={() => fetchTableData(table)}
123 className={selectedTable === table ? "active" : ""}
124 >

scrapeCraigslistAPImain.tsx1 match

@rochambeau314•Updated 9 months ago
9
10 try {
11 const response = await fetch(url);
12 const html = await response.text();
13

slackScoutmain.tsx8 matches

@pochetes•Updated 9 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" },

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago