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=667&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 9164 results for "fetch"(2611ms)

masterPancakeCheckermain.tsx4 matches

@bpugh•Updated 8 months ago
1// This val fetches movie showings hourly, compares with previous data,
2// and sends an email for new movies. It uses the Val Town Blob storage
3// for persistence and the std/email module for sending notifications.
9const STORAGE_KEY = "alamo_showings";
10
11async function fetchShowings() {
12 const response = await fetch(THEATER_API);
13 return await response.json();
14}
37
38export default async function main() {
39 const showings = await fetchShowings();
40 await compareAndNotify(showings);
41 return new Response("Movie showings checked and notifications sent if needed.");

AlgoliaRecordSender2main.tsx1 match

@willthereader•Updated 8 months ago
673
674 try {
675 const response = await fetch(url, {
676 method: "POST",
677 headers: headers,

egoBoostermain.tsx1 match

@stevekrouse•Updated 8 months ago
83
84 console.log("Sending request to /analyze");
85 const response = await fetch('/analyze', {
86 method: 'POST',
87 body: formData

AggregatorAlertmain.tsx4 matches

@alexpetros•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { email, IAddress } from "https://esm.town/v/std/email";
3import { DOMParser, Element } from "jsr:@b-fuze/deno-dom";
38async function checkHN(matchedStories) {
39 // Get the title of the top story on Hacker News
40 const res = await fetch("https://hacker-news.firebaseio.com/v0/topstories.json")
41 const topStories = await res.json()
42 const frontPage = topStories.slice(0, 50)
43
44 const promises = frontPage.map(async storyId => {
45 const res = await fetch(`https://hacker-news.firebaseio.com/v0/item/${storyId}.json`)
46 const story = await res.json()
47 try {
57
58async function checkLobsters(matchedStories) {
59 const res = await fetch(`https://lobste.rs`)
60 const text = await res.text()
61

hnTopStorymain.tsx4 matches

@alexpetros•Updated 8 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4// Get the title of the top story on Hacker News
5export async function hnTopStory() {
6 const topStories: Number[] = await fetch(
7 "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty",
8 ).then((res) => res.json());
15 score: number;
16 by: string;
17 } = await fetchJSON(
18 `https://hacker-news.firebaseio.com/v0/item/${id}.json`,
19 );

lovelyBeigeSolemain.tsx2 matches

@meglado•Updated 8 months ago
1import { verify_discord_signature } from "https://esm.town/v/mattx/verify_discord_signature?v=8";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export type Snowflake = string;
95 (async () => {
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {

discordBotmain.tsx2 matches

@meglado•Updated 8 months ago
1import { verify_discord_signature } from "https://esm.town/v/mattx/verify_discord_signature?v=8";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export type Snowflake = string;
95 (async () => {
96 const data = await response;
97 const update = await fetch(
98 `https://discord.com/api/v10/webhooks/${body.application_id}/${body.token}/messages/@original`,
99 {

VALLErunmain.tsx2 matches

@cofsana•Updated 8 months ago
918 code: newCode,
919 });
920 fetch('/save', { method: "POST", body }).then(() => {
921 document.getElementById('code-input-hidden').value = newCode;
922 document.getElementById('preview-iframe').src += '';
1284 app.post("/", mainHandler);
1285
1286 return passwordAuth(app.fetch, { verifyPassword: verifyToken });
1287}

DailyDaughterNotesmain.tsx5 matches

@heathergliffin•Updated 9 months ago
14
15 useEffect(() => {
16 fetchTodayNote();
17 }, []);
18
19 const fetchTodayNote = async () => {
20 setLoading(true);
21 const response = await fetch("/get-note");
22 const data = await response.json();
23 setNote(data.note);
27 const generateNewNote = async () => {
28 setLoading(true);
29 await fetch("/generate-note", { method: "POST" });
30 await fetchTodayNote();
31 };
32

eldestBronzePtarmiganmain.tsx7 matches

@ejfox•Updated 9 months ago
16
17 useEffect(() => {
18 fetchUser();
19 fetchMatches();
20 }, []);
21
22 const fetchUser = async () => {
23 const response = await fetch('/user');
24 if (response.ok) {
25 const userData = await response.json();
30 };
31
32 const fetchMatches = async () => {
33 const response = await fetch('/matches');
34 if (response.ok) {
35 const matchesData = await response.json();
44 formData.append('type', type);
45
46 const response = await fetch('/upload', {
47 method: 'POST',
48 body: formData,

proxyFetch2 file matches

@vidar•Updated 19 hours ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 1 day ago