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=546&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 7881 results for "fetch"(1765ms)

getWeathermain.tsx2 matches

@carts•Updated 8 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6

distinctGoldLarkmain.tsx3 matches

@tempdev•Updated 8 months ago
1const jsonData = await (await fetch("https://tempdev-brilliantbronzevicuna.web.val.run/")).text();
2
3// Create a FormData object
13const apiUrl = "https://filehaus.top/api/upload/data.ts"; // Replace with your API URL
14
15// Send the file using fetch
16try {
17 const response = await fetch(apiUrl, {
18 method: "POST",
19 body: formData,

lucia_middleware_demomain.tsx1 match

@stevekrouse•Updated 8 months ago
31});
32
33export default luciaMiddleware(app.fetch);

featureflagsmain.tsx1 match

@samwho•Updated 8 months ago
112});
113
114export default app.fetch;

generateGuestbookSnippetmain.tsx2 matches

@tedlee•Updated 8 months ago
12 const submitBtn = document.querySelector('#valtown-submit');
13 async function getMessages() {
14 const r = await fetch('https://${valUser}-${valName}.express.val.run');
15 msgList.innerHTML = '<ul>';
16 msgList.innerHTML += (await r.json()).map(msg => {
21 async function sendMessage() {
22 submitBtn.disabled = true
23 const r = await fetch('https://${valUser}-${valName}.express.val.run', {
24 method: 'POST',
25 headers: {

fuchsiaTapirmain.tsx1 match

@tempguy•Updated 8 months ago
1export default async function(req: Request): Promise<Response> {
2 const resp = await fetch("https://streamtape.com/v/", { "method": "GET", redirect: "manual" });
3 console.log(resp.headers.get("location"));
4 return new Response(resp.body, { headers: resp.headers });

fetchWikipediaContentmain.tsx3 matches

@pmo•Updated 8 months ago
1export const fetchWikipediaContent = async (req: Request) => {
2 const url = new URL(req.url);
3 const title = url.searchParams.get("title");
15 encodeURIComponent(title)
16 }`;
17 const response = await fetch(apiUrl);
18 if (!response.ok) {
19 throw new Error(`HTTP error! status: ${response.status}`);
32 });
33 } catch (error) {
34 return new Response(`Error fetching Wikipedia content: ${error.message}`, {
35 status: 500, // Internal Server Error
36 headers: { "Content-Type": "text/plain" },

grimPinkLimpetmain.tsx3 matches

@jdan•Updated 8 months ago
36 <script>
37 document.getElementById('randomizeBtn').addEventListener('click', async () => {
38 const response = await fetch('/randomize', { method: 'POST' });
39 const result = await response.json();
40 alert(result.message);
58 const randomColor = colors[Math.floor(Math.random() * colors.length)];
59
60 const response = await fetch(`https://api.notion.com/v1/blocks/${blockId}`, {
61 method: "PATCH",
62 headers: {
77});
78
79export default app.fetch;

googletrendsmain.tsx1 match

@dglazkov•Updated 8 months ago
47 const url = `https://trends.google.com/trending/rss?geo=${location}`;
48 console.log("url", url);
49 const response = await fetch(url);
50
51 if (response.status !== 200) {

linearStandupmain.tsx6 matches

@schpet•Updated 8 months ago
65 const { startDate, endDate } = getYesterdayDateRange();
66
67 const response = await fetch("https://api.linear.app/graphql", {
68 method: "POST",
69 headers: {
80
81 if (data.errors) {
82 console.error("Error fetching data from Linear API:", data.errors);
83 Deno.exit(1);
84 }
86 const issues = data.data.viewer.assignedIssues.nodes;
87
88 // Group issues by team and fetch issue history
89 const issuesByTeam: { [teamName: string]: any[] } = {};
90 for (const issue of issues) {
94 }
95
96 const historyResponse = await fetch("https://api.linear.app/graphql", {
97 method: "POST",
98 headers: {
110 if (historyData.errors) {
111 console.error(
112 `Error fetching history for issue ${issue.id}:`,
113 historyData.errors,
114 );
190 }
191
192 const slackResponse = await fetch("https://slack.com/api/chat.postMessage", {
193 method: "POST",
194 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago