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=11&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 15231 results for "fetch"(3138ms)

templateTwitterAlertmain.tsx1 match

@tomjohndesign•Updated 2 days ago
19 : Math.floor((Date.now() - 2 * 24 * 60 * 60 * 1000) / 1000);
20
21 // Fetch and log tweets
22 const response = await socialDataSearch(`${query} since_time:${timeFrame}`);
23 console.log("Response from socialDataSearch:", response);

untitled-2598main.tsx1 match

@join•Updated 2 days ago
379 try {
380 const positions = initialBallState.map(b => ({ number: b.number, x: b.x, y: b.y }));
381 const response = await fetch(API_URL, {
382 method: 'POST',
383 headers: { 'Content-Type': 'application/json' },

github-oauth-templateindex.ts6 matches

@tionis•Updated 2 days ago
40 initialData.user = user;
41 } catch (error) {
42 console.error("Failed to fetch user data:", error);
43 // Clear invalid token
44 deleteCookie(c, "github_token");
165 return c.json(user);
166 } catch (error) {
167 console.error("Failed to fetch user:", error);
168 // Clear invalid token
169 deleteCookie(c, "github_token");
170 return c.json({ error: "Failed to fetch user data" }, 401);
171 }
172});
185 return c.json(repos);
186 } catch (error) {
187 console.error("Failed to fetch repos:", error);
188 return c.json({ error: "Failed to fetch repositories" }, 500);
189 }
190});
248});
249
250export default app.fetch;

barriebaycatsindex.ts3 matches

@flymaster•Updated 2 days ago
2 try {
3 // Download the baseball game log file
4 const response = await fetch(
5 "https://baseball.pointstreak.com/textstats/generate_dynamic.html?report_type=team_game_log_report&seasonid=34122&teamid=165103&download=download&filename=team_game_log_report_165103.txt",
6 );
7
8 if (!response.ok) {
9 throw new Error(`Failed to fetch game log: ${response.status} ${response.statusText}`);
10 }
11
58
59 // Send notification to ntfy.sh
60 const notificationResponse = await fetch("https://ntfy.sh/barriebaycatsresults", {
61 method: "POST",
62 body: lastLine,

petitionmain.tsx1 match

@creativevoicesspeaking•Updated 2 days ago
95
96 try {
97 const verifyResult = await fetch(verifyUrl, {
98 method: "POST",
99 body: verifyData,

github-oauth-templateindex.html6 matches

@tionis•Updated 2 days ago
24 const [state, setState] = useState(initialData);
25
26 const fetchUser = async () => {
27 try {
28 setState(prev => ({ ...prev, loading: true, error: null }));
29 const response = await fetch('/api/user');
30 if (response.ok) {
31 const user = await response.json();
39 };
40
41 const fetchRepos = async () => {
42 try {
43 setState(prev => ({ ...prev, loading: true, error: null }));
44 const response = await fetch('/api/repos');
45 if (response.ok) {
46 const repos = await response.json();
47 setState(prev => ({ ...prev, repos, loading: false }));
48 } else {
49 setState(prev => ({ ...prev, error: 'Failed to fetch repositories', loading: false }));
50 }
51 } catch (error) {
115 h('h2', { className: 'text-2xl font-semibold text-gray-800' }, 'Your Repositories'),
116 h('button', {
117 onClick: fetchRepos,
118 disabled: state.loading,
119 className: 'px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50 transition-colors'

github-oauth-templategithub.ts2 matches

@tionis•Updated 2 days ago
9
10 private async request<T>(endpoint: string): Promise<T> {
11 const response = await fetch(`${this.baseURL}${endpoint}`, {
12 headers: {
13 "Authorization": `Bearer ${this.accessToken}`,
41 }
42
43 const response = await fetch("https://github.com/login/oauth/access_token", {
44 method: "POST",
45 headers: {

reactHonoExampleMessageInput.tsx1 match

@tionis•Updated 2 days ago
11
12 try {
13 const response = await fetch("/messages", {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },

reactHonoExampleindex.ts2 matches

@tionis•Updated 2 days ago
59});
60
61// HTTP vals expect an exported "fetch handler"
62// This is how you "run the server" in Val Town with Hono
63export default app.fetch;

reactHonoExampleApp.tsx4 matches

@tionis•Updated 2 days ago
9 const [messages, setMessages] = React.useState(initialMessages);
10
11 const fetchMessages = async () => {
12 try {
13 const response = await fetch("/messages");
14 const data = await response.json();
15 setMessages(data.reverse());
16 } catch (error) {
17 console.error("Failed to fetch messages", error);
18 }
19 };
23 <h1>💬 Message Board!</h1>
24 <MessageList messages={messages} />
25 <MessageInput onSubmit={fetchMessages} />
26 {thisProjectURL
27 ? (

fake-https1 file match

@blazemcworld•Updated 6 days ago
simple proxy to fetch http urls using https

testWeatherFetcher1 file match

@sjaskeprut•Updated 2 weeks ago