10app.get("/", async (c) => c.html(await sqlite_admin_tables()));
11app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
12export default basicAuth(app.fetch, { verifyUser: (_, password) => verifyToken(password) });
1import { base } from "https://esm.town/v/tempguy/southcloud";
2
3async function fetchStreamLink() {
4 try {
5 const headers = {
8 "Accept-Language": "en-US,en;q=0.5",
9 "x-site": "anicrush",
10 "Sec-Fetch-Dest": "empty",
11 "Sec-Fetch-Mode": "cors",
12 "Sec-Fetch-Site": "same-site",
13 };
14
15 // Fetch search results
16 const search = await fetch("https://api.anicrush.to/shared/v2/movie/list?keyword=One Piece&limit=10&page=1", {
17 headers,
18 });
21 const id = searchResult.result.movies[0].id;
22
23 // Fetch server data
24 const serverData = await fetch(`https://api.anicrush.to/shared/v2/episode/servers?_movieId=${id}&ep=1`, {
25 headers,
26 });
28 const serverId = serverDataResult.result.sub[0].server;
29
30 // Fetch server link
31 const serverLink = await fetch(
32 `https://api.anicrush.to/shared/v2/episode/sources?_movieId=${id}&ep=1&sv=${serverId}&sc=sub`,
33 { headers },
36 const sid = new URL(serverLinkResult.result.link).pathname.split("/")[3];
37
38 // Fetch stream link
39 const streamLink = await fetch(`https://southcloud.tv/e/ajax/p-1/getSources?id=${sid}`);
40 const streamLinkResult = await streamLink.json();
41
43 console.log(base(streamLinkResult.sources)[0].file);
44 } catch (error) {
45 console.error("Error fetching stream link:", error);
46 }
47}
48
49// Call the function
50fetchStreamLink();
1import CryptoJS from "npm:crypto-js";
2const regex = /case (0[xX][\da-fA-F]+):([a-zA-Z\d]+)=(.),([a-zA-Z\d]+)=(.)/gm;
3const req = await fetch("https://southcloud.tv/js/player/a/sc/prod/p1-debug.min.js");
4const str = await req.text();
5let m;
1// This val creates a movie guessing game using the TMDB API.
2// We'll fetch random movies from different years, present them to the user, and check their guesses.
3// Tradeoffs: We're using a free API with authentication for better data variety.
4
13}
14
15async function fetchRandomMovies() {
16 const currentYear = new Date().getFullYear()
17 const movies = []
23 }
24 chosen.add(year)
25 const response = await fetch(
26 `${TMDB_API_BASE}/discover/movie?language=en-US&sort_by=popularity.desc&include_adult=false&include_video=false&page=1&primary_release_year=${year}`,
27 { headers },
213
214 if (req.method === "GET") {
215 const movies = await fetchRandomMovies()
216 const uuid = crypto.randomUUID()
217 const moviesKey = `${author}.${name}.movies.${uuid}`
163. Import `describe` and `it` utilities
174. Write tests
185. Add the badge to your readme, with the `url` parameter pointing to the test suite val's endpoint. Tests run whenever the test suite val or the badge is fetched
19
20```tsx
32
33 const url = "https://raw.githubusercontent.com/Fyrd/caniuse/main/fulldata-json/data-1.0.json";
34 const data = await fetch(url).then((res) => res.json());
35 const updatedAt = data.updated;
36
37 if (previousDataUpdatedAt >= updatedAt) return;
38
39 const fetchedFeatures = Object.keys(data.data);
40
41 const features = [];
42 for (const feature of fetchedFeatures) {
43 const previousFeature = previousData?.[feature];
44 const previousUsage = previousFeature?.usage_perc_y ?? 0;
78const getContent = async (url: string) => {
79 try {
80 const response = await fetch(`https://r.jina.ai/${url}`);
81 if (!response.ok) {
82 throw new Error(`HTTP error! Status: ${response.status}`);
85 return data;
86 } catch (error) {
87 console.error('Error fetching the URL:', error);
88 return 'Error fetching the content.';
89 }
90};
130});
131
132export default app.fetch;
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { 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});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
65
66 try {
67 const response = await fetch(url);
68 if (!response.ok) {
69 throw new Error(`HTTP error! status: ${response.status}`);
72 return data; // Store the JSON data in a variable
73 } catch (error) {
74 console.error("Error fetching data:", error);
75 }
76}
68 headers?: Record<string, string>;
69}) => {
70 let result = await fetch(
71 `${API_URL}/v1/email`,
72 {