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=94&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 9189 results for "fetch"(1163ms)

dood-redirectmain.tsx1 match

@temptemp•Updated 1 week ago
16});
17
18export default app.fetch;

mastodon-pogodanew-file-2457.tsx4 matches

@tomasz•Updated 1 week ago
1const mastodonToken = Deno.env.get("MASTODON_ACCESS_TOKEN");
2
3import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
4import { load } from "npm:cheerio";
5
6async function mastodonWeatherMap() {
7 const html = await fetchText("https://www.bankier.pl//gielda/notowania/indeksy-gpw"); // Przykład linku do strony z ETF-ami
8 const $ = load(html);
9
36const status = await mastodonWeatherMap();
37
38const html = await fetchText(
39 "https://www.bankier.pl//gielda/notowania/indeksy-gpw",
40);
47console.log("lol");
48
49await fetch(`https://mastodon.social/api/v1/statuses`, {
50 method: "POST",
51 headers: {

hn-remote-ts-genai-jobsindex.ts7 matches

@prashamtrivedi•Updated 1 week ago
4 * This script:
5 * 1. Finds the latest "Who's Hiring" thread on Hacker News
6 * 2. Fetches all comments from that thread
7 * 3. Filters for remote jobs requiring TypeScript and GenAI skills
8 * 4. Formats and outputs the results
14import {
15 findLatestWhoIsHiringThread,
16 fetchComments,
17 getFallbackThreadId
18} from "./hackerNewsApi.ts";
26
27/**
28 * Main function to fetch and process job listings
29 */
30export async function findRemoteTSGenAIJobs(): Promise<{
46 }
47
48 console.log("📥 Fetching comments...");
49 const comments = await fetchComments(threadId);
50 console.log(`✅ Fetched ${comments.length} comments`);
51
52 console.log("🔎 Filtering for remote TS+GenAI jobs...");
99 return await blob.getJSON(`${STORAGE_KEY}-latest`);
100 } catch (error) {
101 console.error("Error fetching latest results:", error);
102 return null;
103 }
24
25/**
26 * Fetches a Hacker News item by its ID
27 * @param id The Hacker News item ID
28 * @returns The item data or null if not found
29 */
30export async function fetchItem(id: number): Promise<HNItem | null> {
31 try {
32 const response = await fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`);
33 if (!response.ok) {
34 throw new Error(`Failed to fetch item ${id}: ${response.status}`);
35 }
36 return await response.json();
37 } catch (error) {
38 console.error(`Error fetching item ${id}:`, error);
39 return null;
40 }
42
43/**
44 * Fetches all comments from a Hacker News thread
45 * @param storyId The parent story/thread ID
46 * @returns An array of comment items
47 */
48export async function fetchComments(storyId: number): Promise<HNItem[]> {
49 const story = await fetchItem(storyId);
50 if (!story || !story.kids || story.kids.length === 0) {
51 return [];
52 }
53
54 // Fetch all comments in parallel
55 const commentPromises = story.kids.map(kid => fetchItem(kid));
56 const comments = await Promise.all(commentPromises);
57
72 try {
73 // First get the user information for "whoishiring" account
74 const whoishiringUserInfo = await fetch('https://hacker-news.firebaseio.com/v0/user/whoishiring.json');
75 const userInfo = await whoishiringUserInfo.json();
76
82 const recentSubmissions = userInfo.submitted.slice(0, 10);
83
84 // Fetch details for each submission
85 const submissionPromises = recentSubmissions.map(id => fetchItem(id));
86 const submissions = await Promise.all(submissionPromises);
87

hn-remote-ts-genai-jobsREADME.md2 matches

@prashamtrivedi•Updated 1 week ago
1# Hacker News Remote TypeScript & GenAI Jobs Filter
2
3This Val Town project fetches the latest "Who's Hiring" thread from Hacker News and filters the comments to find remote job opportunities that require TypeScript and GenAI (Generative AI) skills.
4
5## How It Works
6
71. Fetches the latest "Who's Hiring" thread ID from Hacker News
82. Retrieves all comments from that thread
93. Filters comments to find remote job postings that mention TypeScript and GenAI

telegramBotStarterbotFunctions.js4 matches

@asdfg•Updated 1 week ago
183 */
184async function getActiveUsers() {
185 // Fetch raw user data from the blob storage
186 const rawUserKeys = await storage.list({ prefix: "userInfo:" });
187
337 const botToken = process.env.TELEGRAM_BOT_TOKEN;
338
339 const response = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
340 method: "POST",
341 headers: { "Content-Type": "application/json" },
367 const botToken = process.env.TELEGRAM_BOT_TOKEN;
368
369 const response = await fetch(`https://api.telegram.org/bot${botToken}/setWebhook`, {
370 method: "POST",
371 headers: { "Content-Type": "application/json" },
391 const botToken = process.env.TELEGRAM_BOT_TOKEN;
392
393 const response = await fetch(`https://api.telegram.org/bot${botToken}/getWebhookInfo`);
394 const result = await response.json();
395 return result;

my-first-val02_http.tsx2 matches

@stevekrouse•Updated 1 week ago
10
11 // Look up the user's location from their IP
12 const geoResponse = await fetch(`http://ip-api.com/json/${ip}`);
13 const geoData = await geoResponse.json();
14
61});
62
63export default app.fetch;

glastonewsindex.ts7 matches

@bensomething•Updated 1 week ago
1import cheerio from "node:cheerio"; // Use cheerio for HTML parsing
2import fetch from "node:node-fetch"; // Ensure this is installed if not already
3import process from "node:process";
4import { BskyAgent } from "npm:@atproto/api";
9});
10
11async function fetchNews() {
12 const url = "https://glastonburyfestivals.co.uk/news/";
13 try {
14 const response = await fetch(url);
15 if (!response.ok) {
16 throw new Error(`Failed to fetch news: ${response.statusText}`);
17 }
18 const html = await response.text();
31 return news;
32 } catch (error) {
33 console.error("Error fetching news:", error);
34 throw error;
35 }
40 await agent.login({ identifier: process.env.BLUESKY_USERNAME, password: process.env.BLUESKY_PASSWORD });
41
42 // Fetch the latest news
43 const newsItems = await fetchNews();
44
45 // Post each news item to Bluesky
65
66 // Register the commands
67 const response = await fetch(`https://discord.com/api/v10/${endpoint}`, {
68 method: "PUT",
69 headers: {

TownieuseProject.tsx5 matches

@pomdtr•Updated 1 week ago
11 const [error, setError] = useState(null);
12
13 const fetchData = async () => {
14 try {
15 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
23 };
24
25 const { project } = await fetch(projectEndpoint, { headers })
26 .then(res => res.json());
27 const { files } = await fetch(filesEndpoint, { headers })
28 .then(res => res.json());
29
40 useEffect(() => {
41 if (!projectId) return;
42 fetchData();
43 }, [projectId, branchId]);
44
45 return { data, loading, error, refetch: fetchData };
46}
47

proxyFetch2 file matches

@vidar•Updated 1 day ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 1 day ago