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=1054&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 13277 results for "fetch"(4573ms)

slackScoutmain.tsx8 matches

@pochetes•Updated 8 months ago
20 for (const topic of KEYWORDS) {
21 const results = await Promise.allSettled([
22 fetchHackerNewsResults(topic),
23 fetchTwitterResults(topic),
24 fetchRedditResults(topic),
25 ]);
26
49}
50
51// Fetch Hacker news, Twitter, and Reddit results
52async function fetchHackerNewsResults(topic: string): Promise<Website[]> {
53 return hackerNewsSearch({
54 query: topic,
58}
59
60async function fetchTwitterResults(topic: string): Promise<Website[]> {
61 return twitterSearch({
62 query: topic,
67}
68
69async function fetchRedditResults(topic: string): Promise<Website[]> {
70 return redditSearch({ query: topic });
71}
84 }
85
86 const response = await fetch(slackWebhookUrl, {
87 method: "POST",
88 headers: { "Content-Type": "application/json" },

primewiremain.tsx4 matches

@tempdev•Updated 8 months ago
8
9async function search(imdbId: string) {
10 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
11 return await searchResult.json().then((searchResult) => {
12 return searchResult.id;
56 const searchResult = await search(imdbId);
57
58 const title = await fetch(`${primewireBase}/movie/${searchResult}`);
59 const titleResp = await title.text();
60 const embeds = await getStreams(titleResp);
69 const searchResult = await search(imdbId);
70
71 const _season = await fetch(`${primewireBase}/tv/${searchResult}`, {});
72 const season = await _season.text();
73 const seasonPage = load(season);
81 if (!episodeLink) throw new NotFoundError("No episode links found");
82
83 const _title = await fetch(`${primewireBase}/${episodeLink}`);
84 const title = await _title.text();
85 const embeds = await getStreams(title);

healthdatasimplemain.tsx1 match

@ejfox•Updated 8 months ago
39// Client-side rendering
40function client() {
41 fetch('/api/health-data')
42 .then(response => response.json())
43 .then(data => {

handlermain.tsx1 match

@tempdev•Updated 8 months ago
60}
61async function getMeta(imdbId: string): Promise<Meta> {
62 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
63 return await searchResult.json() as Meta;
64}

srcbackendmain.tsx5 matches

@tempdev•Updated 8 months ago
20}
21
22export async function Fetcher(url: string, referer: string) {
23 const design = `?destination=${encodeURIComponent(url)}&referer=${encodeURIComponent(referer)}`;
24 const request = await fetch(`https://eb305cc8-973e-4f2d2-85dd-b1f16649c4d4.cloudflarepreviews.com/proxy${design}`, {
25 headers: {
26 "Cookie": "token=35b2fb9d503a9c50e0564db305bbe971817e63dbfb88c61461eef2afaf0fd6f1",
41 };
42 const baseUrl = "https://d000d.com";
43 const doodData = await Fetcher(`${baseUrl}/e/${id}`, baseUrl);
44 const poster = "";
45 const dataForLater = doodData.match(/\?token=([^&]+)&expiry=/)?.[1];
46 const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
47 const thumbnailTrack = `https:${doodData.match(/thumbnails:\s\{\s*vtt:\s'([^']*)'/)?.[1]}`;
48 const doodPage = await Fetcher(`${baseUrl}/pass_md5${path}`, `${baseUrl}/e/${id}`);
49
50 returnData.extractedURL = `${doodPage}${nanoid()}?token=${dataForLater}&expiry=${Date.now()}`;
71 };
72 const baseUrl = "https://streamtape.com";
73 const embed = await Fetcher(`${baseUrl}/e/${id}`, "");
74 const match = embed.match(/robotlink'\)\.innerHTML = '(.*)'/);
75 if (!match) throw new Error("No match found");

FindFraudTrendsUsingGPTmain.tsx1 match

@mjweaver01•Updated 8 months ago
151});
152
153export default app.fetch;

forbetEventScrappermain.tsx1 match

@nmsilva•Updated 8 months ago
1import { load } from "https://esm.sh/cheerio";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
3
4const defaultAsEmptyString = (value) => value ?? "";

successiveVioletGrousemain.tsx5 matches

@ankitkr0•Updated 8 months ago
22
23 useEffect(() => {
24 fetchLeaderboard();
25 }, []);
26
38 }, [isHolding]);
39
40 const fetchLeaderboard = async () => {
41 const response = await fetch('/leaderboard');
42 const data = await response.json();
43 setLeaderboard(data);
49 setGameState('end');
50 await submitScore();
51 await fetchLeaderboard();
52 };
53
54 const submitScore = async () => {
55 await fetch('/submit-score', {
56 method: 'POST',
57 headers: { 'Content-Type': 'application/json' },

VALLErunmain.tsx2 matches

@ubyk•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}

htmlkitmain.tsx9 matches

@yawnxyz•Updated 8 months ago
1// import { fetch } from "https://esm.town/v/std/fetch";
2import { convertHtmlToMarkdown } from 'npm:@yawnxyz/dom-to-semantic-markdown';
3import { JSDOM } from 'npm:jsdom';
10export async function getHtmlFromUrl(url) {
11 try {
12 const response = await fetch(url);
13 const html = await response.text();
14
17 return $.html();
18 } catch (error) {
19 console.error("Error fetching the URL:", error);
20 return null;
21 }
22}
23
24// todo, pass in html optional, and skip fetch?
25export async function getMetadataFromUrl(url) {
26 const response = await fetch(url, {
27 method: "GET",
28 headers: new Headers({
31 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
32 "Accept-Language": "en-US,en;q=0.5",
33 "Sec-Fetch-Site": "cross-site",
34 "Sec-Fetch-Mode": "navigate",
35 "Sec-Fetch-User": "?1",
36 "Sec-Fetch-Dest": "document",
37 "Referer": "https://www.google.com/",
38 "sec-ch-ua": `"Not A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"`,

GithubPRFetcher

@andybak•Updated 13 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago