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=2&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 14486 results for "fetch"(1699ms)

saveImdbToDebridindex.ts7 matches

@larryhudsonUpdated 8 hours ago
39 : authHeader;
40
41 // Fetch streams from Torrentio
42 const torrentioUrl = `https://torrentio.strem.fun/realdebrid=${rdToken}/stream/movie/${imdbId}.json`;
43
44 console.log(`Fetching streams from: ${torrentioUrl}`);
45
46 const torrentioResponse = await fetch(torrentioUrl);
47 if (!torrentioResponse.ok) {
48 return new Response(`Error: Failed to fetch streams from Torrentio (${torrentioResponse.status}: ${torrentioResponse.statusText})`, {
49 status: 500,
50 headers: { 'Content-Type': 'text/plain' }
131 if (isCached) {
132 // Stream is already cached, just make the range request
133 const rangeResponse = await fetch(selectedStream.url, {
134 headers: {
135 'Range': 'bytes=0-0' // Request only the first byte
146
147 // First, make a request to initiate the download
148 const downloadResponse = await fetch(selectedStream.url, {
149 method: 'GET',
150 headers: {
162 } else {
163 // Fallback for streams that don't match our expected patterns
164 const rangeResponse = await fetch(selectedStream.url, {
165 headers: {
166 'Range': 'bytes=0-0'

wahoearnmain.tsx1 match

@wahobdUpdated 9 hours ago
132// ✅ মেসেজ পাঠানো ফাংশন
133async function sendMessage(chat_id: number, text: string, reply_markup: any = null) {
134 await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
135 method: "POST",
136 headers: { "Content-Type": "application/json" },

reactHonoStarterapo.tsx1 match

@RaazbhaiiUpdated 9 hours ago
58});
59
60export default app.fetch;
2
3async function main() {
4 const response = await fetch(
5 "https://cms.tablemountain.net/admin/actions/submissions/default/weather-api",
6 );

reactHonoStarterindex.ts1 match

@RaazbhaiiUpdated 10 hours ago
242});
243
244export default app.fetch;
245
246function getIcon(iconName: string): string {

reactHonoStarterApp.tsx1 match

@RaazbhaiiUpdated 10 hours ago
10
11 useEffect(() => {
12 fetch("https://Raazbhail-web.val.run/tools") // Replace with your Val Town URL
13 .then((res) => res.json())
14 .then((data) => setTools(data));

proxydatasaver.ts12 matches

@jrcUpdated 10 hours ago
3 *
4 * This code runs as a Val in Val Town with an HTTP trigger.
5 * It fetches web pages and optimizes them based on content type and complexity.
6 */
7
613 const hasModernJS = /<script[^>]*type=['"]module['"][^>]*>/i.test(html);
614 const hasInteractiveElements = /onclick|addEventListener/i.test(html);
615 const hasAjax = /fetch\(|xhr|ajax/i.test(html);
616 const hasPopularLibs = /jquery|react|vue|angular/i.test(html);
617
780
781/**
782 * Fetches content from the target URL
783 */
784async function fetchContent(
785 targetUrl: string,
786 requestHeaders: Headers,
797 });
798
799 console.log(`Fetching URL: ${targetUrl} with request headers:`, httpHeaders);
800 const response = await fetch(targetUrl, { headers: httpHeaders });
801 console.log(
802 `-> status: ${response.status}, response headers:`,
806 if (response.status !== 200) {
807 throw new Error(
808 `Failed to fetch "${targetUrl}". Status: ${response.status}, Status Text: "${response.statusText}"`,
809 );
810 }
844 * Main datasaver function
845 *
846 * @param _url - Required. The URL to fetch and optimize
847 * @param _mode - Optional processing mode: "high" | "med" | "low" | "off"
848 * - high: Article extraction (Readability), strips JS/CSS (blogs, news)
868
869 try {
870 // Fetch the content
871 const { html, contentLength, wasCompressed } = await fetchContent(
872 targetUrl,
873 req.headers,
936 console.error("Target URL:", targetUrl);
937
938 if (error instanceof TypeError && String(error).includes("fetch")) {
939 return new Response(
940 `Failed to fetch URL: ${targetUrl}. Error: ${error.message}`,
941 {
942 status: 400,

personal_trmnlmalifold_cron.tsx2 matches

@ramtinalamiUpdated 10 hours ago
11 console.log("⏰ Cron fired at", new Date(interval.lastRunAt).toISOString());
12
13 // 1) Fetch latest 30 markets
14 const raw = await fetch(MANIFOLD_URL).then(r => r.json());
15 const rawJson = JSON.stringify(raw);
16

qkwen02_http.tsx1 match

@bishojoismUpdated 10 hours ago
7 forwardedHeaders.delete("host");
8
9 const res = await fetch(targetUrl, {
10 method: req.method,
11 headers: forwardedHeaders,

weather-aimain.tsx6 matches

@helgeUpdated 11 hours ago
12
13async function getWeather(latitude: number, longitude: number): Promise<WeatherData> {
14 console.log(`[getWeather] Fetching weather for lat: ${latitude}, lon: ${longitude}`);
15 const url =
16 `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&current=temperature_2m,wind_speed_10m&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m`;
17 console.log(`[getWeather] URL: ${url}`);
18
19 const response = await fetch(url);
20 console.log(`[getWeather] Response status: ${response.status}`);
21
37 console.log(`[getCoordinates] Using corsproxy.io`);
38
39 const response = await fetch(proxyUrl, {
40 headers: {
41 "User-Agent": "WeatherApp/1.0",
68 };
69 } catch (error) {
70 console.error(`[getCoordinates] Error fetching coordinates:`, error);
71 return {
72 latitude: 0,
80 const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
81
82 const response = await fetch("https://openrouter.ai/api/v1/chat/completions", {
83 method: "POST",
84 headers: {
307
308 try {
309 const response = await fetch('/api/weather', {
310 method: 'POST',
311 headers: {

testWeatherFetcher1 file match

@sjaskeprutUpdated 2 days ago

weatherFetcher1 file match

@sjaskeprutUpdated 2 days ago