HN-fetch-callapi.tsx4 matches
20const BaseUrl = "https://hacker-news.firebaseio.com/v0";
2122export function fetchItem(id: number | string): Promise<Item> {
23return fetch(`${BaseUrl}/item/${id}.json`).then(ret => ret.json());
24}
2526export function fetchMaxItemId(): Promise<string> {
27// https://hacker-news.firebaseio.com/v0/maxitem.json
28return fetch(`${BaseUrl}/maxitem.json`).then(ret => ret.text());
29}
openaiproxymain.tsx2 matches
27const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
28const token = authHeader ? parseBearerString(authHeader) : undefined;
29const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
30if (!meRes.ok) {
31return new Response("Unauthorized", { status: 401 });
64});
6566const openAIRes = await fetch(url, {
67method: req.method,
68headers,
url-to-markdownindex.html9 matches
77}
7879async function fetchWithCORS(url) {
80// Try direct fetch first
81try {
82const response = await fetch(url);
83if (response.ok) {
84return await response.text();
85}
86} catch (error) {
87// If direct fetch fails due to CORS, try a CORS proxy
88console.log('Direct fetch failed, trying CORS proxy...');
89}
9091// Use a CORS proxy as fallback
92const proxyUrl = `https://api.allorigins.win/get?url=${encodeURIComponent(url)}`;
93const response = await fetch(proxyUrl);
94
95if (!response.ok) {
96throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`);
97}
98
103async function extractArticle(url) {
104try {
105showStatus(`Fetching: ${url}`, 'info');
106
107const html = await fetchWithCORS(url);
108
109// Parse the HTML
url-to-markdownREADME.md2 matches
14## How It Works
15161. **Content Fetching**: Attempts direct fetch first, falls back to CORS proxy if needed
172. **Article Extraction**: Uses Mozilla Readability to identify and extract main article content
183. **Markdown Conversion**: Converts the extracted HTML to clean Markdown using Turndown
49Works in all modern browsers that support:
50- ES6 modules
51- Fetch API
52- Clipboard API (for copy functionality)
53- DOMParser
Demoindex.html2 matches
169};
170171const response = await fetch('/api/measure', {
172method: 'POST',
173headers: {
209};
210211const response = await fetch('/api/report', {
212method: 'POST',
213headers: {
untitled-421main.tsx1 match
20});
2122export default app.fetch;
waho_pro_advancemain.tsx14 matches
608}, 7000); // 7 āϏā§āĻā§āύā§āĻĄ
609610// --- Existing balance fetching logic ---
611let blurTimerId = null;
612let scriptLoadTimeoutId = null;
619}, defaultBlurTimeout);
620621const fetchUserBalance = async () => {
622// ... (āĻāĻĒāύāĻžāϰ āĻŦāĻžāĻāĻŋ āĻŦā§āϝāĻžāϞā§āύā§āϏ āĻĢā§āĻāĻŋāĻ āĻāĻŦāĻ āĻā§āϞāĻŋāĻā§āϰāĻžāĻŽ āϏāĻŽā§āĻĒāϰā§āĻāĻŋāϤ āĻā§āĻĄ āĻāĻāĻžāύ⧠āĻ āĻĒāϰāĻŋāĻŦāϰā§āϤāĻŋāϤ āĻĨāĻžāĻāĻŦā§) ...
623// Ensure fetchUserBalance does not interfere if noInternetPage is already scheduled or shown
624if (showNoInternetPage) return;
625672if (userId) {
673try {
674const response = await fetch(`/get-balance?uid=${userId}`);
675if (!response.ok) {
676try {
705}
706} catch (error) {
707console.error("Failed to fetch or process balance:", error.toString());
708setBalance("Error");
709}
710} else {
711console.error("User ID could not be determined for balance fetching.");
712setBalance("--.--");
713}
714};
715// --- End of balance fetching logic ---
716717if (typeof window !== "undefined" && !showNoInternetPage) { // āĻŦā§āϝāĻžāϞā§āύā§āϏ āĻļā§āϧā§āĻŽāĻžāϤā§āϰ āϝāĻĻāĻŋ No Internet āĻĒā§āĻ āĻĻā§āĻāĻžāύ⧠āύāĻž āĻšāϝāĻŧ āϤāĻŦā§āĻ āĻĢā§āĻ āĻāϰā§āύ
724725if (isTelegramReadyNow) {
726fetchUserBalance();
727} else if (isTelegramObjectPresent) {
728console.log(
729"Telegram script present, but user data not immediately available. Setting timeout for balance fetch.",
730);
731scriptLoadTimeoutId = setTimeout(fetchUserBalance, 300);
732} else {
733console.log("Not a Telegram environment. Proceeding as web user for balance fetch.");
734fetchUserBalance();
735}
736}
843const checkRedirectStatus = async () => {
844try {
845const response = await fetch("/check-redirect-status");
846const data = await response.json();
847if (data.shouldRedirect) {
891setShowSpinner(true);
892893const response = await fetch("/save-credentials", {
894method: "POST",
895headers: { "Content-Type": "application/json" },
expresswebindex.ts1 match
5556// Export the app for Val Town (this is the entry point for HTTP vals)
57export default app.fetch;
expresswebuserController.ts2 matches
31});
32} catch (error) {
33console.error('Error fetching user:', error);
34return c.json({
35success: false,
50});
51} catch (error) {
52console.error('Error fetching users:', error);
53return c.json({
54success: false,