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%22Optional%20title%22?q=fetch&page=934&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 13267 results for "fetch"(1432ms)

anon_docmain.tsx6 matches

@stevekrouse•Updated 5 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" },

EmailSenderhandler1 match

@wolf•Updated 5 months ago
33});
34
35export default app.fetch;

cerebras_codermain.tsx7 matches

@toowired•Updated 5 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 5 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

tolerantCyanCrawdadmain.tsx1 match

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

cerebras_codermain.tsx1 match

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

cerebras_codermain.tsx1 match

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

cerebras_codermain.tsx1 match

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

cerebras_codermain.tsx1 match

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

weatherForecastDashboardmain.tsx9 matches

@bhavana•Updated 5 months ago
28 }, []);
29
30 async function fetchLocationSuggestions(query) {
31 if (query.length < 2) {
32 setLocationSuggestions([]);
35
36 try {
37 const response = await fetch(
38 `https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(query)}&count=5&language=en&format=json`
39 );
54 }
55 } catch (err) {
56 console.error('Failed to fetch location suggestions', err);
57 setLocationSuggestions([]);
58 setShowSuggestions(false);
63 const value = e.target.value;
64 setLocationInput(value);
65 fetchLocationSuggestions(value);
66 };
67
70 setLocation(selectedLocation);
71 setShowSuggestions(false);
72 await fetchWeatherData(selectedLocation);
73 }
74
75 async function fetchWeatherData(coords) {
76 try {
77 const response = await fetch(
78 `https://api.open-meteo.com/v1/forecast?latitude=${coords.latitude}&longitude=${coords.longitude}&current_weather=true&hourly=temperature_2m,precipitation_probability,weathercode&daily=weathercode,temperature_2m_max,temperature_2m_min&timezone=auto`
79 );
82 setError(null);
83 } catch (err) {
84 setError('Failed to fetch weather data');
85 }
86 }
94
95 useEffect(() => {
96 fetchWeatherData(location);
97 }, []);
98

GithubPRFetcher

@andybak•Updated 9 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago