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=388&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 7615 results for "fetch"(1783ms)

intelligentCyanGibbonmain.tsx1 match

@Johner•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

anon_docmain.tsx6 matches

@kate•Updated 4 months ago
51 const id = path.split("/")[2];
52 if (id && id !== "undefined") {
53 fetchDocument(id);
54 setMode(path.startsWith("/view/") ? "view" : "edit");
55 } else {
59 }, []);
60
61 const fetchDocument = async (id) => {
62 try {
63 const response = await fetch(`/api/document/${id}`);
64 if (!response.ok) {
65 throw new Error(`HTTP error! status: ${response.status}`);
70 setForkId(data.id);
71 } catch (e) {
72 console.error("Error fetching document:", e);
73 setError("Error fetching document. Please try again.");
74 }
75 };
78 e.preventDefault();
79 try {
80 const response = await fetch("/api/document", {
81 method: "POST",
82 headers: { "Content-Type": "application/json" },

telegramSetMessageReactionmain.tsx2 matches

@snowypowers•Updated 4 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3interface ReactionType {
32 is_big: boolean;
33}) =>
34 fetchJSON(
35 `https://api.telegram.org/bot${botToken}/setMessageReaction`,
36 {

anon_docmain.tsx6 matches

@stevekrouse•Updated 4 months ago
51 const id = path.split("/")[2];
52 if (id && id !== "undefined") {
53 fetchDocument(id);
54 setMode(path.startsWith("/view/") ? "view" : "edit");
55 } else {
59 }, []);
60
61 const fetchDocument = async (id) => {
62 try {
63 const response = await fetch(`/api/document/${id}`);
64 if (!response.ok) {
65 throw new Error(`HTTP error! status: ${response.status}`);
70 setForkId(data.id);
71 } catch (e) {
72 console.error("Error fetching document:", e);
73 setError("Error fetching document. Please try again.");
74 }
75 };
78 e.preventDefault();
79 try {
80 const response = await fetch("/api/document", {
81 method: "POST",
82 headers: { "Content-Type": "application/json" },

cerebras_codermain.tsx7 matches

@toowired•Updated 4 months ago
15 const { latitude, longitude } = position.coords;
16 setLocation(`${latitude.toFixed(4)}, ${longitude.toFixed(4)}`);
17 fetchWeather(latitude, longitude);
18 }, () => {
19 setLocation("Location not available");
23 }, []);
24
25 const fetchWeather = async (latitude, longitude) => {
26 try {
27 const response = await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current_weather=true`);
28 const data = await response.json();
29 setWeather(`${data.current_weather.temperature}°C, ${getWeatherDescription(data.current_weather.weathercode)}`);
30 } catch (error) {
31 console.error("Error fetching weather:", error);
32 setWeather("Weather data unavailable");
33 }
70 const loadTackleBox = async () => {
71 try {
72 const response = await fetch("/api/tackleBox");
73 if (response.ok) {
74 const data = await response.json();
167 formData.append("image", lureImage);
168 try {
169 const response = await fetch("/api/uploadImage", {
170 method: "POST",
171 body: formData,
185
186 try {
187 const response = await fetch("/api/tackleBox", {
188 method: "POST",
189 headers: {

idealJadeGerbilmain.tsx1 match

@Johner•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

tolerantCyanCrawdadmain.tsx1 match

@Johner•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@Johner•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@kturner2017•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

cerebras_codermain.tsx1 match

@niclasedge•Updated 4 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago