emperorOfJapanCrawlermain.tsx2 matches
1// This program crawls Wikipedia pages starting from an initial URL,
2// following links in the infobox and collecting page titles.
3// It uses the fetch API to make HTTP requests and cheerio for HTML parsing.
45import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
12visited.add(url);
1314const response = await fetch(url);
15const html = await response.text();
16const $ = cheerio.load(html);
2constructor(public author: string) {}
34fetch = async (req: Request) => {
5const url = new URL(req.url);
6const [name, ...args] = url.pathname.slice(1).split("/");
1011const results = [];
12const metaResponse = await fetch(
13`https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
14);
22const episodeIdentifier = `${data.identifier}-episode-${ep}`;
23return [
24fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
25fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
26];
27}
158159const results = [];
160const metaResponse = await fetch(
161`https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
162);
169const episodeIdentifier = `${data.identifier}-episode-${ep}`;
170return [
171fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
172fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
173];
174}
222);
223});
224export default app.fetch;
188setIsLoading(true);
189try {
190const response = await fetch("/summarize", {
191method: "POST",
192headers: { "Content-Type": "application/json" },
blob_adminmain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138139export default modifyFetchHandler(passwordAuth(app.fetch));
scarletSolemain.tsx3 matches
32url: "https://d000d.com/e/9x3w3pu0xemy",
33};
34const req = await fetch("http://turnsolver.pythonanywhere.com/solve", {
35method: "POST",
36headers: { "Content-Type": "application/json" },
39const tokenReq = await req.json();
40const token = tokenReq.token;
41const ver = await fetch(
42`https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=`
43+ encodeURIComponent(`https://d0000d.com/dood?op=validate&gc_response=${token}`),
66return c.json({ worked: true });
67});
68export default app.fetch;
dailyDadJokemain.tsx2 matches
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
34export async function dailyDadJoke() {
5let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6return email({
7text: punchline,
legitimateTanTigermain.tsx13 matches
4* The suggestions are cached in the browser to reduce API calls.
5* It implements a two-step LLM process: first to get initial suggestions, then to filter them for sensibility and ethics.
6* If the second LLM call fails, it displays "Failed to fetch" instead of showing results.
7*/
819const suggestionCache = useRef({});
2021const fetchSuggestions = async (input) => {
22if (suggestionCache.current[input]) {
23setSuggestions(suggestionCache.current[input]);
28setError("");
29try {
30const response = await fetch("/suggestions", {
31method: "POST",
32headers: { "Content-Type": "application/json" },
33body: JSON.stringify({ query: input }),
34});
35if (!response.ok) throw new Error("Failed to fetch suggestions");
36const data = await response.json();
37if (data.error) {
43}
44} catch (error) {
45console.error("Error fetching suggestions:", error);
46setError("Failed to fetch");
47setSuggestions([]);
48} finally {
51};
5253const debouncedFetchSuggestions = useRef(
54debounce(fetchSuggestions, 300),
55).current;
5657useEffect(() => {
58if (query.length > 2) {
59debouncedFetchSuggestions(query);
60} else {
61setSuggestions([]);
115116try {
117const response = await fetch("https://api.cerebras.ai/v1/chat/completions", {
118method: "POST",
119headers: {
137138if (!response.ok) {
139throw new Error("Failed to fetch from Cerebras API");
140}
141146147// Second LLM call to filter suggestions
148const filterResponse = await fetch("https://api.cerebras.ai/v1/chat/completions", {
149method: "POST",
150headers: {
190} catch (error) {
191console.error("Error calling Cerebras API:", error);
192return new Response(JSON.stringify({ error: "Failed to fetch" }), {
193status: 500,
194headers: { "Content-Type": "application/json" },
39}, [selectedLocation]);
4041const fetchSuggestions = async (input) => {
42if (suggestionCache.current[input]) {
43setSuggestions(suggestionCache.current[input]);
47setIsLoading(true);
48try {
49const response = await fetch("/geocode", {
50method: "POST",
51headers: { "Content-Type": "application/json" },
52body: JSON.stringify({ query: input }),
53});
54if (!response.ok) throw new Error("Failed to fetch suggestions");
55const data = await response.json();
56setSuggestions(data);
57suggestionCache.current[input] = data;
58} catch (error) {
59console.error("Error fetching suggestions:", error);
60setSuggestions([]);
61} finally {
64};
6566const debouncedFetchSuggestions = useRef(
67debounce(fetchSuggestions, 300)
68).current;
6970useEffect(() => {
71if (query.length > 2) {
72debouncedFetchSuggestions(query);
73} else {
74setSuggestions([]);
128129try {
130const response = await fetch("https://api.cerebras.ai/v1/chat/completions", {
131method: "POST",
132headers: {
146147if (!response.ok) {
148throw new Error("Failed to fetch from Cerebras API");
149}
150158} catch (error) {
159console.error("Error calling Cerebras API:", error);
160return new Response(JSON.stringify({ error: "Failed to fetch suggestions" }), {
161status: 500,
162headers: { "Content-Type": "application/json" },
dataUriGenAppmain.tsx1 match
200app.get('/main.js', serve(js, 'text/javascript'));
201202export default app.fetch;