extractTextmain.tsx2 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export async function extractText(data, name) {
4const fileUrl =
5"https://www.gcmgrosvenor.com/wp-content/uploads/Private-Credit-Co-investing-GCM-Grosvenor.pdf";
6const blob = await fetch(fileUrl).then((r) => r.blob());
7const pdfjs = await import("npm:pdfjs-dist"); //https://www.npmjs.com/package/pdf-to-text
8return Object.keys(pdfjs);
smsjournalerregistrationmain.tsx2 matches
14try {
15const sanitizedPhoneNumber = phoneNumber.replace(/\D/g, "");
16const response = await fetch("/submit", {
17method: "POST",
18headers: { "Content-Type": "application/json" },
75// submit to relayUrl/register as a post with phone in json body
76// use shared secret as bearer auth
77const response = await fetch(relayURL + "/register", {
78method: "POST",
79headers: {
npmExplorermain.tsx9 matches
2* This val creates an enhanced NPM package explorer using the npm registry API.
3* It displays a grid of npm packages with basic information, categories, and navigation.
4* The approach uses React for the frontend and fetch for API calls.
5* It includes a details view for each package, a link to the npm page, and category navigation.
6* Icons are added for each category, and additional pill boxes are included for specific topics.
106const [loading, setLoading] = useState(false);
107108const fetchPackages = useCallback(async () => {
109setLoading(true);
110let url = `/search?q=${encodeURIComponent(searchTerm)}&size=${ITEMS_PER_PAGE}&from=${(page - 1) * ITEMS_PER_PAGE}`;
113}
114try {
115const response = await fetch(url);
116const data = await response.json();
117setPackages(data.objects || []);
118} catch (error) {
119console.error("Error fetching packages:", error);
120setPackages([]);
121} finally {
125126useEffect(() => {
127fetchPackages();
128}, [fetchPackages]);
129130const handleSearch = (e) => {
131e.preventDefault();
132setPage(1);
133fetchPackages();
134};
135289290try {
291const response = await fetch(apiUrl);
292const data = await response.json();
293return new Response(JSON.stringify(data), {
295});
296} catch (error) {
297console.error("Error fetching from npm registry:", error);
298return new Response(JSON.stringify({ objects: [] }), {
299status: 500,
lastlogin_demomain.tsx1 match
25});
2627export default lastlogin(app.fetch);
95tokenUrl.searchParams.set("state", store.state);
9697const tokenResp = await fetch(tokenUrl.toString());
98if (!tokenResp.ok) {
99throw new Error(await tokenResp.text());
104};
105106const resp = await fetch("https://lastlogin.io/userinfo", {
107headers: {
108Authorization: `Bearer ${access_token}`,
sqliteExplorerAppmain.tsx4 matches
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
23import { 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});
176177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
test_migratedmain.tsx1 match
76if (valURL) {
77try {
78await fetch(valURL)
79.then(res => res.json())
80.then(res => {
textStoragemain.tsx26 matches
5152useEffect(() => {
53fetchTexts();
54fetchTemplates();
55fetchCategories();
56fetchHistory();
57}, []);
5859const fetchTexts = async () => {
60const response = await fetch('/texts');
61const data = await response.json();
62setTexts(data);
63};
6465const fetchTemplates = async () => {
66const response = await fetch('/templates');
67const data = await response.json();
68setTemplates(data);
69};
7071const fetchCategories = async () => {
72const response = await fetch('/categories');
73const data = await response.json();
74setCategories(data);
75};
7677const fetchHistory = async () => {
78const response = await fetch('/history');
79const data = await response.json();
80setHistory(data);
95const method = editingText && editingText.id !== 0 ? 'PUT' : 'POST';
9697const response = await fetch(url, {
98method,
99headers: { 'Content-Type': 'application/json' },
102103if (response.ok) {
104fetchTexts();
105fetchCategories();
106fetchHistory();
107setModalOpen(false);
108setEditingText(null);
124const method = 'PUT';
125126const response = await fetch(url, {
127method,
128headers: { 'Content-Type': 'application/json' },
131132if (response.ok) {
133fetchTemplates();
134setModalOpen(false);
135setEditingTemplate(null);
139140const deleteText = async (id: number) => {
141const response = await fetch(`/texts/${id}`, { method: 'DELETE' });
142if (response.ok) {
143fetchTexts();
144fetchCategories();
145fetchHistory();
146}
147};
155};
156157const response = await fetch('/texts', {
158method: 'POST',
159headers: { 'Content-Type': 'application/json' },
162163if (response.ok) {
164fetchTexts();
165fetchCategories();
166fetchHistory();
167setActiveTab("texts");
168}
memeGeneratormain.tsx1 match
3031useEffect(() => {
32fetch("/templates")
33.then(response => response.json())
34.then(data => setTemplates(data));