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/$%7Bsuccess?q=fetch&page=686&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 8641 results for "fetch"(3336ms)

telegramSendMessagemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramSendMessage = async (botToken: string, options: TelegramSendMessageOptions) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/sendMessage`,
6 {

telegramSendPhotomain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const telegramSendPhoto = async (botToken: string, options: TelegramSendPhotoOptions) =>
4 fetchJSON(
5 `https://api.telegram.org/bot${botToken}/sendPhoto`,
6 {

passkeys_demomain.tsx1 match

@hlobil•Updated 1 year ago
298 return c.json("success");
299});
300export default app.fetch;

letterboxdmain.tsx3 matches

@javier•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
2
3export const letterboxd = async (username: string) => {
5 const URL = `https://letterboxd.com/${username}/films/diary/`;
6 const getTotalPages = async () => {
7 const html = await fetchText(URL);
8 const $ = cheerio.load(html);
9 return +$(".paginate-page a").last().text();
10 };
11 const getFilmsForPage = async (page) => {
12 const html = await fetchText(URL + "page/" + page);
13 const $ = cheerio.load(html);
14 return $(".diary-entry-edit a").map((i, metadata) => {

isMyWebsiteDownmain.tsx2 matches

@moonbe77•Updated 1 year ago
9 let reason: string;
10 try {
11 const res = await fetch(URL, { redirect: "follow" });
12 if (res.status !== 200) {
13 reason = `(status code: ${res.status})`;
15 }
16 } catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

libsqlstudio_drivermain.tsx2 matches

@pomdtr•Updated 1 year ago
61
62 async transaction(stmts: InStatement[]): Promise<DatabaseResultSet[]> {
63 const r = await fetch(`/api/batch`, {
64 method: "POST",
65 headers: {
81
82 async query(stmt: InStatement): Promise<DatabaseResultSet> {
83 const r = await fetch(`/api/execute`, {
84 method: "POST",
85 headers: {

sapphireManateemain.tsx1 match

@thecurryman•Updated 1 year ago
4
5export let isBoeing = async (airline, number) => {
6 const response = await fetch("https://www.flightstats.com/v2/flight-tracker/" + airline + "/" + number);
7 const body = await response.text();
8 const $ = cheerio.load(body);

ismyplaneaboeingmain.tsx1 match

@thecurryman•Updated 1 year ago
4
5export let isBoeing = async (airline, number) => {
6 const response = await fetch("https://www.flightstats.com/v2/flight-tracker/" + airline + "/" + number);
7 const body = await response.text();
8 const $ = cheerio.load(body);

testingmain.tsx4 matches

@samhashemi•Updated 1 year ago
1// import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3// export let comments = ["hello world!"];
4
5// export let twitterJSON = ({ url, bearerToken }) =>
6// fetchJSON(
7// "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
8// { headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` } },
10
11// export function handler(request: Request) {
12// let elements = fetchJSON(
13// "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
14// { headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` } },
19
20export default async function(req: Request): Promise<Response> {
21 return fetch(
22 "https://felt.com/api/v1/maps/SssjclTrScGmH4TfPHzNjD/elements",
23 // headers: { authorization: `Bearer ${"felt_pat_ZAqb6bBSE2Na1wDVtZQE17p/sK/+odCnpa1CqLMkcXA"}` }

btcPriceAlertmain.tsx3 matches

@omaismoe•Updated 1 year ago
2import { blob } from "https://esm.town/v/std/blob?v=11";
3import { email } from "https://esm.town/v/std/email?v=9";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
5
6let currency = async (desired, base = "usd", amount = 1) => {
7 // let { rates } = await fetchJSON(`https://open.er-api.com/v6/latest/${base}`);
8 // if (rates && rates[desired.toUpperCase()]) return amount * (rates[desired.toUpperCase()]);
9 // else {
10 let { rates } = await fetchJSON("https://api.coingecko.com/api/v3/exchange_rates");
11 return amount * rates[desired.toLowerCase()]?.value / rates[base.toLowerCase()]?.value;
12};

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago