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=734&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 9013 results for "fetch"(1157ms)

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 });

latestBlogContentmain.tsx2 matches

@simonw•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function latestBlogContent() {
4 return (
5 await fetch(
6 "https://datasette.simonwillison.net/simonwillisonblog.json?_shape=array&sql=select+%27entry%27+as+type%2C+title%2C+created%2C+%27https%3A%2F%2Fsimonwillison.net%2Fe%2F%27+%7C%7C+id+as+url+from+blog_entry%0D%0Aunion+all%0D%0Aselect+%27blogmark%27+as+type%2C+link_title%2C+created%2C+%27https%3A%2F%2Fsimonwillison.net%2Fb%2F%27+%7C%7C+id+from+blog_blogmark%0D%0Aunion+all%0D%0Aselect+%27quotation%27+as+type%2C+source%2C+created%2C+%27https%3A%2F%2Fsimonwillison.net%2Fq%2F%27+%7C%7C+id+from+blog_quotation%0D%0Aorder+by+created+desc"
7 )

openaiUploadFilemain.tsx2 matches

@yawnxyz•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function openaiUploadFile({ key, data, filename = "data.json", purpose = "assistants" }: {
17 formData.append("purpose", purpose);
18 formData.append("file", file, filename);
19 let result = await fetch("https://api.openai.com/v1/files", {
20 method: "POST",
21 headers: {

TAC_FetchBasic2 file matches

@A7_OMC•Updated 9 hours ago

hn-fetch1 file match

@matija•Updated 11 hours ago