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?q=fetch&page=117&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 9424 results for "fetch"(1556ms)

Discord_Bot_Servicesmap-vote-tallying.tsx1 match

@ktodaz•Updated 1 week ago
68 return rateLimitService.executeWithRateLimit(routeKey, async () => {
69 console.log(`🔄 Sending request to ${url}`);
70 const response = await fetch(url, {
71 ...options,
72 headers,
28
29 console.log(`🔄 Sending request to ${url}`);
30 const response = await fetch(url, {
31 ...options,
32 headers,
luciaMagicLinkStarter

luciaMagicLinkStarterindex.ts2 matches

@stevekrouse•Updated 1 week ago
24});
25
26// HTTP vals expect an exported "fetch handler"
27// This is how you "run the server" in Val Town with Hono
28export default app.fetch;
66 return rateLimitService.executeWithRateLimit(routeKey, async () => {
67 console.log(`🔄 Sending request to ${url}`);
68 const response = await fetch(url, {
69 ...options,
70 headers,
109 const token = Deno.env.get("DISCORD_BOT_TOKEN");
110
111 const response = await fetch(url, {
112 method: "PUT",
113 headers: {

crypto-geminiscript.tsx11 matches

@hexmanshu•Updated 1 week ago
2// Make sure to set the COINGECKO_API_KEY environment variable in Val Town
3
4import { fetch } from "npm:undici"; // Use undici for fetch in Node.js environment
5
6interface CoinGeckoMarketCoin {
57const FNG_API_URL = "https://api.alternative.me/fng/?limit=1";
58
59async function fetchFromApi<T>(url: string, isCoinGecko: boolean = true): Promise<T | null> {
60 const headers: HeadersInit = {};
61 if (isCoinGecko && COINGECKO_API_KEY) {
65
66 try {
67 const response = await fetch(url, { headers });
68 if (!response.ok) {
69 const errorText = await response.text();
73 return await response.json() as T;
74 } catch (error) {
75 console.error(`Network or Fetch Error for ${url}: `, error);
76 return null;
77 }
100 topCoinsData,
101 ] = await Promise.all([
102 fetchFromApi<CoinGeckoMarketCoin[]>(`${COINGECKO_API_BASE}/coins/markets?vs_currency=usd&ids=bitcoin`),
103 fetchFromApi<CoinGeckoChartData>(
104 `${COINGECKO_API_BASE}/coins/bitcoin/market_chart?vs_currency=usd&days=30&interval=daily`,
105 ),
106 fetchFromApi<FearAndGreedData>(FNG_API_URL, false), // false for isCoinGecko
107 fetchFromApi<CoinGeckoGlobalData>(`${COINGECKO_API_BASE}/global`),
108 fetchFromApi<CoinGeckoMarketCoin[]>(
109 `${COINGECKO_API_BASE}/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=10&page=1&sparkline=true&price_change_percentage=7d`,
110 ),
124 });
125 } catch (error) {
126 console.error("Error fetching dashboard data:", error);
127 return new Response(JSON.stringify({ error: "Failed to fetch dashboard data" }), {
128 headers: { ...corsHeaders, "Content-Type": "application/json" },
129 status: 500,

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

proxyFetch2 file matches

@vidar•Updated 2 days ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago