102 tokenUrl.searchParams.set("state", store.state);
103
104 const tokenResp = await fetch(tokenUrl.toString());
105 if (!tokenResp.ok) {
106 throw new Error(await tokenResp.text());
111 };
112
113 const resp = await fetch("https://lastlogin.io/userinfo", {
114 headers: {
115 Authorization: `Bearer ${access_token}`,
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { 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});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));
23 console.log("Searching for threadmark buttons...");
24 const buttons = document.querySelectorAll(
25 "div.structItem-cell--main[data-xf-click=\"threadmark-fetcher\"]",
26 );
27 console.log(`Found ${buttons.length} potential threadmark buttons.`);
29 let newButtonsClicked = false;
30 for (let button of buttons) {
31 const fetchUrl = button.dataset.fetchurl;
32 const originalTitle = button.getAttribute("data-original-title");
33
34 if (
35 fetchUrl && fetchUrl.includes("threadmarks-load-range")
36 && fetchUrl.includes("min") && fetchUrl.includes("max")
37 && originalTitle && originalTitle.includes("hidden")
38 && !clickedButtons.has(fetchUrl)
39 ) {
40 console.log(`Clicking threadmark button with fetchUrl: ${fetchUrl}`);
41 button.click();
42 await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for load
43 clickedButtons.add(fetchUrl);
44 newButtonsClicked = true;
45 totalClicked++;
33 page: nth + 1,
34 });
35 const res = await fetch(`${BASE_URL}/search/text/?${queryString}`);
36 const json = await res.json();
37 return json.results.map((sound: FreeSoundResponse) => ({
142 setIsLoading(true);
143 try {
144 const response = await fetch('/api/submit-url', {
145 method: 'POST',
146 headers: {
162 const loadUrlDatabase = async () => {
163 try {
164 const response = await fetch('/api/load-urls');
165 if (!response.ok) throw new Error('Failed to load URLs');
166 const loadedUrls = await response.json();
267 setIsLoading(true);
268 for (let i = 0; i < tracks.length; i++) {
269 const result = await fetchSound(tracks[i].search, 0);
270 if (result) {
271 setTracks(prevTracks => prevTracks.map((track, index) =>
277 };
278
279 const fetchSound = async (query, index) => {
280 try {
281 const response = await fetch(`${searchUrl}?q=${encodeURIComponent(query)}`);
282 const data = await response.json();
283 if (data.results && data.results.length > 0) {
284 const sound = data.results[index % data.results.length];
285 const audioResponse = await fetch(sound.previews["preview-hq-mp3"]);
286 const arrayBuffer = await audioResponse.arrayBuffer();
287 const decodedData = await audioCtx.current.decodeAudioData(arrayBuffer);
290 }
291 } catch (error) {
292 console.error("Error fetching sound:", error);
293 }
294 return null;
357 setTracks(newTracks);
358
359 const result = await fetchSound(newSearch, index - 1);
360 if (result) {
361 newTracks[trackIndex] = {
215 const newTracks = [...tracks];
216 for (let i = 0; i < TRACKS; i++) {
217 const sound = await fetchSound(tracks[i].search, tracks[i].index);
218 if (sound) {
219 newTracks[i].sound = sound.buffer;
225 };
226
227 const fetchSound = async (query, index) => {
228 const search = query.toLowerCase().replaceAll(" ", "-");
229 try {
230 const response = await fetch(searchUrl + "/" + search);
231 const results = await response.json();
232 if (results.length > 0) {
233 const soundUrl = results[0].mp3s[0];
234 const audioResponse = await fetch(soundUrl);
235 const arrayBuffer = await audioResponse.arrayBuffer();
236 const audioBuffer = await audioCtx.current.decodeAudioData(arrayBuffer);
243 }
244 } catch (error) {
245 console.error("Error fetching sound:", error);
246 }
247 return null;
276 const newTracks = [...tracks];
277 newTracks[trackIndex].search = newSearch;
278 const sound = await fetchSound(newSearch, index);
279 newTracks[trackIndex].sound = sound.buffer;
280 newTracks[trackIndex].soundId = sound.id;
13 console.log(`Submitting URL for scraping: ${url}`);
14 try {
15 const response = await fetch("/scrape", {
16 method: "POST",
17 headers: { "Content-Type": "application/json" },
88 const threadmarkResults = await Promise.all(threadmarkCategories.map(async (category) => {
89 const threadmarkUrl = `${url}/threadmarks?hide_wrapper=1&display=embedded&threadmark_category=${category}`;
90 const response = await fetch(
91 `https://app.scrapingbee.com/api/v1/?api_key=${apiKey}&url=${
92 encodeURIComponent(threadmarkUrl)
94 );
95 if (!response.ok) {
96 console.log(`Error fetching threadmarks for category ${category}`);
97 return null;
98 }
137 }`;
138
139 const response = await fetch(requestUrl, {
140 method: "GET",
141 });
1import * as esbuild from "https://deno.land/x/esbuild@v0.24.0/wasm.js";
2
3const resp = await fetch(import.meta.url);
4const ts: string = await resp.text();
5
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { 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});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));