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=711&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 8783 results for "fetch"(2266ms)

notehubmain.tsx2 matches

@rdimartino•Updated 1 year ago
7 body.append("client_secret", Deno.env.get("NOTEHUB_CLIENT_SECRET"));
8
9 const res = await fetch("https://notehub.io/oauth2/token", {
10 method: "POST",
11 headers: {
22 try {
23 const token = await authenticate();
24 const res = await fetch(
25 `https://api.notefile.net/v1/projects/${projectUID}/devices/${deviceUID}/notes/${fileName}`,
26 {

markdown_downloadmain.tsx5 matches

@yawnxyz•Updated 1 year ago
103 }
104
105 const dom_promise = fetch(url.toString(), {
106 method: req.method,
107 headers: new Headers({
110 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
111 "Accept-Language": "en-US,en;q=0.5",
112 "Sec-Fetch-Site": "cross-site",
113 "Sec-Fetch-Mode": "navigate",
114 "Sec-Fetch-User": "?1",
115 "Sec-Fetch-Dest": "document",
116 "Referer": "https://www.google.com/",
117 "sec-ch-ua": `"Not A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"`,

key_value_apimain.tsx1 match

@brianleroux•Updated 1 year ago
22});
23
24export default app.fetch;

dailyDadJokemain.tsx2 matches

@ajn•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

aquaCoyotemain.tsx1 match

@Llad•Updated 1 year ago
4app.get("/", (c) => c.text("Hello from Hono!"));
5app.get("/yeah", (c) => c.text("Routing!"));
6export default app.fetch;

telegramSendMessagemain.tsx4 matches

@sjmre•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2import axios from "npm:axios";
3import formData from "npm:form-data";
16 reply_markup?: any[];
17}) =>
18 fetchJSON(
19 `https://api.telegram.org/bot${botToken}/sendMessage`,
20 {
34
35 try {
36 // Replace axios with Deno's fetch API, adapted for your setup
37 const response = await fetch(url, {
38 method: "POST",
39 body: data, // FormData instance directly as the body

fetchRssREADME.md1 match

@svoisen•Updated 1 year ago
1This is an RSS parser val, similar to @stevekrouse.fetchRSS, but uses an NPM parsing library
2so it can support multiple RSS feed types easily.

fetchRssmain.tsx4 matches

@svoisen•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3// This supports more RSS types than @stevekrouse.fetchRSS
4export async function fetchRss(url: string, lastRunDate?: string | number) {
5 let Parser = await import("npm:rss-parser");
6 let parser = new Parser.default();
7 let response = await fetch(url);
8 let data = await response.text();
9 let { items } = await parser.parseString(data);

azureNewtmain.tsx4 matches

@suhaasy•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

valToGHmain.tsx2 matches

@nbbaier•Updated 1 year ago
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=42";
3import { Octokit } from "npm:@octokit/rest";
4import { DateTime } from "npm:luxon";
127
128 try {
129 const { code } = await fetchJSON(`${API_URL}/v1/alias/${vtUser}/${valName}`, {
130 headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` },
131 });

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago