182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
38}
3940async function fetchAndCacheData() {
41try {
42console.log("Fetching URL:", url);
43const response = await fetch(url, {
44headers: {
45"User-Agent":
72return bootstrapData;
73} catch (error) {
74console.error("Error fetching and caching data:", error);
75const cachedData = await blob.getJSON(cacheKey);
76if (cachedData) {
79...cachedData.data,
80_cachedAt: cachedData.timestamp,
81_cacheNotice: "This is cached data. Live fetching failed.",
82};
83}
8788async function getFullData() {
89const data = await fetchAndCacheData();
90const donationGoal = data.checkoutLink.checkout_link_data.donation_goal;
91const totalRaised = data.donationGoalProgress;
107108async function getDonationProgress() {
109const data = await fetchAndCacheData();
110const donationGoal = data.checkoutLink.checkout_link_data.donation_goal;
111return Response.json({
121122async function getCheckoutDetails() {
123const data = await fetchAndCacheData();
124return Response.json({
125checkoutTitle: data.checkoutTitle,
130131async function getCampaignInfo() {
132const data = await fetchAndCacheData();
133const linkData = data.checkoutLink.checkout_link_data;
134return Response.json({
141142async function getScrapedData() {
143const data = await fetchAndCacheData();
144const donationGoal = data.checkoutLink.checkout_link_data.donation_goal;
145const totalRaised = data.donationGoalProgress;
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));
libgenopdsmain.tsx7 matches
1import { fetch } from "https://esm.town/v/std/fetch";
2import { load } from "npm:cheerio";
311url.searchParams.set("q", query);
1213const html = await fetch(url).then(r => r.text());
1415const $ = load(html);
95}
9697async function fetchMetadataLibgenRs(
98url: string | undefined,
99identifier: string | undefined = undefined,
102const origin = new URL(url as string).origin;
103104const html = await fetch(url as string).then(r => r.text());
105106const $ = load(html);
150}
151152async function fetchMetadataLibgenLi(
153url: string | undefined,
154identifier: string | undefined = undefined,
157const origin = new URL(url as string).origin;
158159const html = await fetch(url as string).then(r => r.text());
160161const $ = load(html);
266const results = await search(query);
267const libgenMetadata = await Promise.all(results.map(async (result) => {
268const libgenMetadata = await fetchMetadataLibgenRs(result.libgenRsURL, result.url, result.language?.[0]);
269return {
270...result,
1import { sleep } from "https://deno.land/x/sleep/mod.ts";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { parentReference } from "https://esm.town/v/stevekrouse/parentReference";
4import { searchParams } from "https://esm.town/v/stevekrouse/searchParams";
8384export async function makeRequest(id: string, method: "release" | "acquire", params): Promise<LockResponse> {
85return fetchJSON(
86`https://dlock.univalent.net/lock/${id}/${method}?${searchParams(params)}`,
87);
zyloxAIChatAppmain.tsx1 match
2223try {
24const response = await fetch("/chat", {
25method: "POST",
26headers: { "Content-Type": "application/json" },
compassionateBlackCatfishmain.tsx2 matches
164165try {
166const response = await fetch(API_URL, {
167method: "POST",
168headers: {
229
230try {
231const response = await fetch(API_URL, {
232method: "POST",
233headers: {
stellarCrimsonPandamain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
gistFetchermain.tsx4 matches
20getFileData(fileName),
21);
22const fetcher = () => {
23const gistUrl = "https://api.github.com/gists/979a41207cb789364e2c78181bafc331";
2425return fetch(gistUrl)
26.then(response => {
27if (!response.ok) throw new Error("Failed to fetch data from GitHub Gist.");
28return response.json();
29})
44};
4546export default fetcher;