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/$%7Burl%7D?q=fetch&page=682&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 14357 results for "fetch"(6441ms)

faq_chatbotmain.tsx2 matches

@sunmade•Updated 1 month ago
15 setIsLoading(true);
16 try {
17 const response = await fetch(`/search?q=${encodeURIComponent(searchTerm)}`);
18 const data = await response.json();
19 setResults(data);
39
40 try {
41 const response = await fetch('/chat', {
42 method: 'POST',
43 headers: {

moiPosterApp.tsx4 matches

@dcm31•Updated 1 month ago
26
27 useEffect(() => {
28 const fetchProjects = async () => {
29 try {
30 setLoading(true);
34 setProjects(projects || []);
35 } catch (err) {
36 console.error("Error fetching projects:", err);
37 setError("Failed to load projects. Please try again later.");
38 } finally {
41 };
42
43 fetchProjects();
44 }, []);
45
64 }
65 } catch (err) {
66 console.error("Error fetching project details:", err);
67 setError("Failed to load project details. Please try again later.");
68 }

moiPosterindex.ts8 matches

@dcm31•Updated 1 month ago
22 const username = userInfo.username;
23
24 // Now fetch all public projects
25 const projects = await valtown.getUserProjects(username, { privacy: "public" });
26
27 return c.json(projects);
28 } catch (error) {
29 console.error("Error fetching projects:", error);
30 return c.json({ error: "Failed to fetch projects" }, 500);
31 }
32});
40 return c.json(filesData);
41 } catch (error) {
42 console.error("Error fetching project files:", error);
43 return c.json({ error: "Failed to fetch project files" }, 500);
44 }
45});
58 return c.json(fileData);
59 } catch (error) {
60 console.error("Error fetching file content:", error);
61 return c.json({ error: "Failed to fetch file content" }, 500);
62 }
63});
117});
118
119export default app.fetch;

Val_Geomain.tsx1 match

@DegVal•Updated 1 month ago
101
102 try {
103 const response = await fetch("/analyze", {
104 method: "POST",
105 body: formData,

CSBotmain.tsx1 match

@Charlcy_a•Updated 1 month ago
47
48 try {
49 const response = await fetch("/support", {
50 method: "POST",
51 body: JSON.stringify({ query: input })

Iris1main.tsx11 matches

@Ibiyedi•Updated 1 month ago
10 const handleSubmit = async (e) => {
11 e.preventDefault();
12 const response = await fetch("/job", {
13 method: "POST",
14 headers: { "Content-Type": "application/json" },
72
73 useEffect(() => {
74 fetchMessages();
75 const interval = setInterval(fetchMessages, 5000);
76 return () => clearInterval(interval);
77 }, []);
78
79 const fetchMessages = async () => {
80 const response = await fetch("/messages");
81 if (response.ok) {
82 const data = await response.json();
87 const sendMessage = async (e) => {
88 e.preventDefault();
89 const response = await fetch("/messages", {
90 method: "POST",
91 headers: { "Content-Type": "application/json" },
94 if (response.ok) {
95 setNewMessage("");
96 fetchMessages();
97 }
98 };
125 const [jobs, setJobs] = useState([]);
126
127 const fetchJobs = async () => {
128 const response = await fetch("/job");
129 if (response.ok) {
130 const data = await response.json();
134
135 useEffect(() => {
136 fetchJobs();
137 }, []);
138
142 <div className="app-container">
143 <div className="left-panel">
144 <JobPostingForm onSubmit={fetchJobs} />
145 <JobBoard jobs={jobs} />
146 </div>

Foodiesmain.tsx1 match

@ShaneDevX•Updated 1 month ago
81
82 try {
83 const response = await fetch('/submit-order', {
84 method: 'POST',
85 headers: { 'Content-Type': 'application/json' },

Val1main.tsx4 matches

@anoms•Updated 1 month ago
10
11async function refreshGmailAccessToken(refreshToken: string) {
12 const response = await fetch("https://oauth2.googleapis.com/token", {
13 method: "POST",
14 headers: { "Content-Type": "application/x-www-form-urlencoded" },
25
26async function getUnreadEmails(accessToken: string) {
27 const response = await fetch(
28 "https://gmail.googleapis.com/gmail/v1/users/me/messages?q=is:unread",
29 {
39
40async function getEmailDetails(messageId: string, accessToken: string) {
41 const response = await fetch(
42 `https://gmail.googleapis.com/gmail/v1/users/me/messages/${messageId}`,
43 {
53
54async function sendWhatsAppMessage(body: string) {
55 const response = await fetch("https://api.twilio.com/2010-04-01/Accounts/" + TWILIO_ACCOUNT_SID + "/Messages.json", {
56 method: "POST",
57 headers: {

dreamyOliveNewtmain.tsx13 matches

@October•Updated 1 month ago
23 const { latitude, longitude } = position.coords;
24 setLocation({ latitude, longitude });
25 fetchWeather(latitude, longitude);
26 },
27 (err) => {
28 // Fallback to Johannesburg if geolocation fails
29 setError(`Geolocation error: ${err.message}`);
30 fetchWeather(-26.2041, 28.0473);
31 },
32 {
38 } else {
39 // Fallback to Johannesburg if geolocation not supported
40 fetchWeather(-26.2041, 28.0473);
41 }
42 }, []);
43
44 async function fetchCoordinates(cityName) {
45 try {
46 const geoResponse = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(cityName)}&count=1&language=en&format=json`);
47 const geoData = await geoResponse.json();
48
59 }
60
61 async function fetchWeather(lat, lon) {
62 try {
63 setLoading(true);
64 const response = await fetch(
65 `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}&current_weather=true&hourly=temperature_2m,temperature_fahrenheit,weathercode,apparent_temperature,precipitation_probability,windspeed_10m,uv_index,relativehumidity_2m&daily=weathercode,temperature_2m_max,temperature_2m_min,sunrise,sunset,uv_index_max&timezone=Africa/Johannesburg`
66 );
78 setError(null);
79 } catch (err) {
80 setError(`Weather fetch error: ${err.message}`);
81 setLoading(false);
82 }
93 async (position) => {
94 const { latitude, longitude } = position.coords;
95 await fetchWeather(latitude, longitude);
96 },
97 (err) => {
98 // Fallback to Johannesburg coordinates
99 const defaultCoords = { latitude: -26.2041, longitude: 28.0473 };
100 fetchWeather(defaultCoords.latitude, defaultCoords.longitude);
101 setError(`Geolocation error: ${err.message}`);
102 },
117
118 try {
119 const coords = await fetchCoordinates(cityInput);
120 if (coords) {
121 await fetchWeather(coords.latitude, coords.longitude);
122 }
123 } catch (err) {
130 const newUnit = temperatureUnit === 'celsius' ? 'fahrenheit' : 'celsius';
131 setTemperatureUnit(newUnit);
132 fetchWeather(location.latitude, location.longitude);
133 };
134

Postonlinkedin_migratedmain.tsx1 match

@MainaW•Updated 1 month ago
19
20 try {
21 const response = await fetch("/send-email", {
22 method: "POST",
23 headers: {

FetchBasic2 file matches

@ther•Updated 1 week ago

GithubPRFetcher

@andybak•Updated 2 weeks ago