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=345&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 5857 results for "fetch"(1683ms)

sendGridEmailsmain.tsx1 match

@ianmenethil•Updated 4 months ago
68 headers?: Record<string, string>;
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {

cerebras_codermain.tsx1 match

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

sharedTextBoxmain.tsx7 matches

@wolf•Updated 4 months ago
12 const isTyping = useRef(false);
13
14 const fetchContent = useCallback(async () => {
15 if (!key) return;
16 const response = await fetch(`/content?key=${encodeURIComponent(key)}`);
17 if (response.ok) {
18 const data = await response.json();
27 useEffect(() => {
28 if (key) {
29 fetchContent();
30 const interval = setInterval(fetchContent, 2000);
31 return () => clearInterval(interval);
32 }
33 }, [key, fetchContent]);
34
35 const debouncedSave = useDebouncedCallback(async (newContent) => {
36 if (!key) return;
37 const response = await fetch("/content", {
38 method: "POST",
39 headers: { "Content-Type": "application/json" },
47 } else {
48 // Handle conflict
49 fetchContent();
50 }
51 isTyping.current = false;

OpenAImain.tsx1 match

@ianmenethil•Updated 4 months ago
12 * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
13 * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
14 * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
15 * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
16 * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.

cerebras_codermain.tsx1 match

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

cerebras_codermain.tsx1 match

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

SolanaJupiterTxParsermain.tsx1 match

@ryoid•Updated 4 months ago
51 .send();
52 if (!rpcTx) {
53 throw new Error("Unable to fetch transaction");
54 }
55 console.log("Tx landed at slot", rpcTx.slot);

blob_adminmain.tsx23 matches

@caizoryan•Updated 4 months ago
234 const [isDragging, setIsDragging] = useState(false);
235
236 const fetchBlobs = useCallback(async () => {
237 setLoading(true);
238 try {
239 const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240 const data = await response.json();
241 setBlobs(data);
242 } catch (error) {
243 console.error("Error fetching blobs:", error);
244 } finally {
245 setLoading(false);
248
249 useEffect(() => {
250 fetchBlobs();
251 }, [fetchBlobs]);
252
253 const handleSearch = (e) => {
264 setBlobContentLoading(true);
265 try {
266 const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267 const content = await response.text();
268 setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
269 setEditContent(content);
270 } catch (error) {
271 console.error("Error fetching blob content:", error);
272 } finally {
273 setBlobContentLoading(false);
278 const handleSave = async () => {
279 try {
280 await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281 method: "PUT",
282 body: editContent,
290 const handleDelete = async (key) => {
291 try {
292 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293 setBlobs(blobs.filter(b => b.key !== key));
294 if (selectedBlob && selectedBlob.key === key) {
307 const key = `${searchPrefix}${file.name}`;
308 formData.append("key", encodeKey(key));
309 await fetch("/api/blob", { method: "POST", body: formData });
310 const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311 setBlobs([newBlob, ...blobs]);
315 }
316 }
317 fetchBlobs();
318 };
319
329 try {
330 const fullKey = `${searchPrefix}${key}`;
331 await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332 method: "PUT",
333 body: "",
344 const handleDownload = async (key) => {
345 try {
346 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347 const blob = await response.blob();
348 const url = window.URL.createObjectURL(blob);
363 if (newKey && newKey !== oldKey) {
364 try {
365 const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366 const content = await response.blob();
367 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368 method: "PUT",
369 body: content,
370 });
371 await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372 setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373 if (selectedBlob && selectedBlob.key === oldKey) {
383 const newKey = `__public/${key}`;
384 try {
385 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386 const content = await response.blob();
387 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388 method: "PUT",
389 body: content,
390 });
391 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393 if (selectedBlob && selectedBlob.key === key) {
402 const newKey = key.slice(9); // Remove "__public/" prefix
403 try {
404 const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405 const content = await response.blob();
406 await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407 method: "PUT",
408 body: content,
409 });
410 await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411 setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412 if (selectedBlob && selectedBlob.key === key) {
826});
827
828export default lastlogin((request: Request) => app.fetch(request));

cerebras_codermain.tsx1 match

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

blueskyAlertmain.tsx2 matches

@ianv•Updated 4 months ago
6const agent = new AtpAgent({
7 service: "https://public.api.bsky.app/",
8 // fetch, ideally we'd use our @std/fetch proxy here but that doesn't work and I don't know why
9});
10
30 }
31
32 const response = await fetch(slackWebhookUrl, {
33 method: "POST",
34 headers: { "Content-Type": "application/json" },

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago