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=468&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 8146 results for "fetch"(1584ms)

SermonGPTUImain.tsx9 matches

@mjweaver01•Updated 4 months ago
91 const [autoScroll, setAutoScroll] = useState(true);
92
93 // Fetch saved sermons on component mount
94 useEffect(() => {
95 const fetchSermons = async () => {
96 try {
97 const response = await fetch(`${endpointURL}/sermons`);
98 const data = await response.json();
99 console.log("Fetched sermons:", data); // Debugging log
100 // Ensure data is an array, even if it's empty
101 setSermons(Array.isArray(data) ? data : []);
102 } catch (error) {
103 console.error("Failed to fetch sermons:", error);
104 // Set to empty array in case of error
105 setSermons([]);
107 };
108
109 fetchSermons();
110 }, []);
111
169
170 try {
171 const response = await fetch(`${endpointURL}/delete-sermon/${sermonId}`, {
172 method: "DELETE",
173 });
200
201 try {
202 const res = await fetch(`${endpointURL}/save-sermon`, {
203 method: "POST",
204 headers: {
233
234 try {
235 const res = await fetch(`${endpointURL}/stream`, {
236 method: "POST",
237 body: JSON.stringify({ question }),

legendaryVioletBovidmain.tsx4 matches

@stevekrouse•Updated 4 months ago
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
41 setStats(data);
42 }
43 fetchStats();
44 }, []);
45
146
147 try {
148 const response = await fetch("/", {
149 method: "POST",
150 body: JSON.stringify({

notionSiteRssmain.tsx4 matches

@bao•Updated 4 months ago
13
14 try {
15 // Fetch database metadata
16 const databaseMetadata = await notion.databases.retrieve({
17 database_id: databaseId,
18 });
19
20 // Fetch pages from the database
21 const response = await notion.databases.query({
22 database_id: databaseId,
24 property: "Published", // Customize based on your database schema
25 checkbox: {
26 equals: true, // Only fetch published pages
27 },
28 },
48 });
49 } catch (error) {
50 console.error("Error fetching Notion pages:", error);
51 return new Response("Error retrieving pages", { status: 500 });
52 }

tweetArchiveViewermain.tsx10 matches

@nulo•Updated 4 months ago
17const COBALT_API_URL = "https://dorsiblancoapicobalt.nulo.in";
18
19async function fetchMedia(url) {
20 try {
21 const response = await fetch(COBALT_API_URL, {
22 method: "POST",
23 headers: {
53 return data;
54 } catch (error) {
55 console.error("Error fetching media:", error);
56 return null;
57 }
58}
59
60async function fetchTweets(dumpFile) {
61 try {
62 const response = await fetch(BASE_URL + dumpFile);
63 if (!response.ok) {
64 throw new Error(`HTTP error! status: ${response.status}`);
91 return { tweets, totalProcessed };
92 } catch (error) {
93 console.error("Error fetching or parsing data:", error);
94 throw new Error("Error al cargar los tweets. Por favor, intentá de nuevo más tarde.");
95 }
134 const media = await Promise.all(tweet.mediaUrls.map(async (media) => {
135 if (media.type === "video") {
136 const fetchedMedia = await fetchMedia(media.url);
137 return fetchedMedia ? { ...media, fetchedUrl: fetchedMedia.url } : media;
138 }
139 return media;
171 <div key={index} className="video-container">
172 <video controls poster={media.preview} className="tweet-video" onLoadedMetadata={onMediaLoad}>
173 <source src={media.fetchedUrl || media.url} type="video/mp4" />
174 Your browser does not support the video tag.
175 </video>
235 setError(null);
236 try {
237 const { tweets: newTweets, totalProcessed: newTotalProcessed } = await fetchTweets(selectedDump.file);
238 setTweets(newTweets);
239 setFilteredTweets(newTweets);

valreadmegeneratormain.tsx1 match

@prashamtrivedi•Updated 4 months ago
42
43 try {
44 const response = await fetch(`/generate-readme/${user}/${val}`);
45
46 if (!response.ok) {

valreadmegeneratorREADME.md2 matches

@prashamtrivedi•Updated 4 months ago
29
302. **Generate:**
31 - Click on 'Generate README' and watch as the application swiftly fetches and processes the Val code to create a Markdown README.
32
333. **Copy and Share:**
42- **TailwindCSS:** For styling the application.
43- **Deno:** The server-side environment.
44- **ValTown SDK:** Integrated to fetch Val details.
45- **OpenAI GPT-4:** To generate natural language README content.
46- **JavaScript Modules (ESM):** For seamless module imports.

personalSocialCardGeneratormain.tsx1 match

@mumu•Updated 4 months ago
10 event.preventDefault();
11 const formData = new FormData(event.target);
12 const response = await fetch("/generate", {
13 method: "POST",
14 body: formData,

cerebras_codermain.tsx7 matches

@adnane007al•Updated 4 months ago
36
37 useEffect(() => {
38 async function fetchStats() {
39 const response = await fetch("/dashboard-stats");
40 const data = await response.json();
41 setStats(data);
42 }
43 fetchStats();
44 }, []);
45
128
129 useEffect(() => {
130 async function fetchUsageStats() {
131 const response = await fetch("/usage-stats");
132 const data = await response.json();
133 setUsageStats(data);
134 }
135 fetchUsageStats();
136 }, []);
137
141
142 try {
143 const response = await fetch("/", {
144 method: "POST",
145 body: JSON.stringify({

blueskyAlertmain.tsx1 match

@eseidel•Updated 4 months ago
7const agent = new AtpAgent({
8 service: "https://public.api.bsky.app/",
9 // fetch, ideally we'd use our @std/fetch proxy here but that doesn't work and I don't know why
10});
11

simpleChatAPImain.tsx5 matches

@haeliyan•Updated 4 months ago
14
15 useEffect(() => {
16 fetchMessages();
17 }, []);
18
19 const fetchMessages = async () => {
20 const response = await fetch("/messages");
21 const data = await response.json();
22 setMessages(data);
30 }
31 localStorage.setItem("chatUsername", username);
32 await fetch("/messages", {
33 method: "POST",
34 headers: { "Content-Type": "application/json" },
39 });
40 setNewMessage("");
41 fetchMessages();
42 };
43

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago