56for (const TestCase of TestCases) {
57try {
58const Response = await fetch(ValURL, { headers:TestCase.Headers })
59const Body = await Response.text()
60
wallpaperAppmain.tsx2 matches
25const imageUrl = `https://maxm-imggenurl.web.val.run/${safePrompt}`;
26
27// Prefetch image to ensure it loads
28const response = await fetch(imageUrl);
29if (!response.ok) {
30throw new Error('Failed to generate image');
remasterbackendmain.tsx6 matches
20}
2122export async function Fetcher(url: string, referer: string) {
23const design = `?destination=${encodeURIComponent(url)}&referer=${encodeURIComponent(referer)}`;
24const request = await fetch(
25`https://1fd98a05-4959-42bc4-2f83-2c487c1cde6d.cloudflarepreviews.com/${design}`,
26{
54};
55const baseUrl = "https://rapidplayers.com";
56const embed = await Fetcher(`${baseUrl}/e/${id}`, baseUrl);
57const pr = /p}\('(.*?)',(\d+),(\d+),'(.*?)'\.split/gm;
58const ps = /sources:\[{file:\"(.*?)\"/gm;
86};
87const baseUrl = "https://d000d.com";
88const doodData = await Fetcher(`${baseUrl}/e/${id}`, baseUrl);
89console.log(doodData);
90const poster = "";
92const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
93const thumbnailTrack = `https:${doodData.match(/thumbnails:\s\{\s*vtt:\s'([^']*)'/)?.[1]}`;
94const doodPage = await Fetcher(`${baseUrl}/pass_md5${path}`, `${baseUrl}/e/${id}`);
9596returnData.extractedURL = `${doodPage}${nanoid()}?token=${dataForLater}&expiry=${Date.now()}`;
117};
118const baseUrl = "https://streamtape.com";
119const embed = await Fetcher(`${baseUrl}/e/${id}`, "");
120console.log(`${baseUrl}/e/${id}`);
121const match = embed.match(/robotlink'\)\.innerHTML = '(.*)'/);
primewireUtilsmain.tsx4 matches
89async function search(imdbId: string) {
10const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
11return await searchResult.json().then((searchResult) => {
12return searchResult.id;
56const searchResult = await search(imdbId);
57console.log(`${primewireBase}/movie/${searchResult}`);
58const title = await fetch(`${primewireBase}/movie/${searchResult}`);
59const titleResp = await title.text();
60const embeds = await getStreams(titleResp);
69const searchResult = await search(imdbId);
7071const _season = await fetch(`${primewireBase}/tv/${searchResult}`, {});
72const season = await _season.text();
73const seasonPage = load(season);
81if (!episodeLink) throw new NotFoundError("No episode links found");
8283const _title = await fetch(`${primewireBase}/${episodeLink}`);
84const title = await _title.text();
85const embeds = await getStreams(title);
sqliteExplorerAppmain.tsx4 matches
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
receiveAndSavePointsmain.tsx1 match
50});
5152export default app.fetch;
react_client_forkmain.tsx5 matches
14setNewTodo("");
15// Sending new todo to server
16await fetch('/add-todo', {
17method: 'POST',
18headers: {
27setTodos(updatedTodos);
28// Optionally, update server
29await fetch('/delete-todo', {
30method: 'POST',
31headers: {
110111function client() {
112const fetchTodos = async () => {
113const response = await fetch('/todos');
114const todos = await response.json();
115return todos;
116};
117118fetchTodos().then(initialTodos => {
119createRoot(document.getElementById("root")).render(<App initialTodos={initialTodos} />);
120});
sitesUptimeMonitormain.tsx2 matches
14start = performance.now();
15try {
16const res = await fetch(url);
17end = performance.now();
18status = res.status;
25} catch (e) {
26end = performance.now();
27reason = `couldn't fetch: ${e}`;
28ok = false;
29console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
weatherBasedActivityAlertingmain.tsx3 matches
62forecastUrl.searchParams.set("forecast_days", "7");
6364const forecastResponse = await fetch(forecastUrl.toString());
6566if (!forecastResponse.ok) {
146await email({
147subject: "❌ Weather Forecast Error",
148text: `An error occurred while fetching the weather forecast: ${error.message}`,
149html: `
150<h2>Weather Forecast Error</h2>
151<p>An error occurred while fetching the weather forecast:</p>
152<pre>${error.message}</pre>
153<p><a href="${import.meta.url.replace("esm.town", "val.town")}" target="_top">View Val Source</a></p>
blob_adminmain.tsx23 matches
234const [isDragging, setIsDragging] = useState(false);
235236const fetchBlobs = useCallback(async () => {
237setLoading(true);
238try {
239const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240const data = await response.json();
241setBlobs(data);
242} catch (error) {
243console.error("Error fetching blobs:", error);
244} finally {
245setLoading(false);
248249useEffect(() => {
250fetchBlobs();
251}, [fetchBlobs]);
252253const handleSearch = (e) => {
264setBlobContentLoading(true);
265try {
266const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267const content = await response.text();
268setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
269setEditContent(content);
270} catch (error) {
271console.error("Error fetching blob content:", error);
272} finally {
273setBlobContentLoading(false);
278const handleSave = async () => {
279try {
280await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281method: "PUT",
282body: editContent,
290const handleDelete = async (key) => {
291try {
292await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293setBlobs(blobs.filter(b => b.key !== key));
294if (selectedBlob && selectedBlob.key === key) {
307const key = `${searchPrefix}${file.name}`;
308formData.append("key", encodeKey(key));
309await fetch("/api/blob", { method: "POST", body: formData });
310const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311setBlobs([newBlob, ...blobs]);
315}
316}
317fetchBlobs();
318};
319329try {
330const fullKey = `${searchPrefix}${key}`;
331await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332method: "PUT",
333body: "",
344const handleDownload = async (key) => {
345try {
346const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347const blob = await response.blob();
348const url = window.URL.createObjectURL(blob);
363if (newKey && newKey !== oldKey) {
364try {
365const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366const content = await response.blob();
367await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368method: "PUT",
369body: content,
370});
371await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373if (selectedBlob && selectedBlob.key === oldKey) {
383const newKey = `__public/${key}`;
384try {
385const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386const content = await response.blob();
387await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388method: "PUT",
389body: content,
390});
391await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393if (selectedBlob && selectedBlob.key === key) {
402const newKey = key.slice(9); // Remove "__public/" prefix
403try {
404const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405const content = await response.blob();
406await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407method: "PUT",
408body: content,
409});
410await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412if (selectedBlob && selectedBlob.key === key) {
826});
827828export default lastlogin((request: Request) => app.fetch(request));