blobbyFacemain.tsx15 matches
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
2import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=74";
3import { blobby } from "https://esm.town/v/yawnxyz/blobby";
57}
5859// Endpoint to fetch blob by key
60app.get("/blob/:key", async (c) => {
61const key = c.req.param("key");
181this.blobs[key] = {isLoading: true};
182
183const response = await fetch('/blob/' + key);
184const contentType = response.headers.get('Content-Type');
185blob.type = contentType || 'text/plain';
211let blob = this.blobs[key];
212try {
213const response = await fetch('/create/' + key, {
214method: 'POST',
215headers: {
235236// Send a delete request to the server
237const response = await fetch('/delete/' + key, { method: 'GET' });
238239// Check the response status
301
302try {
303const response = await fetch('/upload/' + key, {
304method: 'POST',
305body: formData,
326
327try {
328const response = await fetch('/uploadUrl' + '?key=' + key + '&url=' + url);
329
330if (!response.ok) {
349if (!this.newKeyName) return;
350try {
351const response = await fetch('/rename?key='+key+'&newKey='+this.newKeyName);
352if (!response.ok) {
353throw new Error('Failed to rename blob');
512async loadBlob() {
513this.isLoading = true;
514const response = await fetch('/blob/' + this.key);
515const contentType = response.headers.get('Content-Type');
516this.blobType = contentType || 'text/plain';
536async updateCreate() {
537try {
538const response = await fetch('/create/' + this.key, {
539method: 'POST',
540headers: {
559560try {
561const response = await fetch('/upload/' + this.key, {
562method: 'POST',
563body: formData,
579if (this.uploadUrl) {
580try {
581const response = await fetch('/uploadUrl?key=' + this.key + '&url=' + this.uploadUrl);
582583if (!response.ok) {
596if (!this.newKeyName) return;
597try {
598const response = await fetch('/rename?key=' + this.key + '&newKey=' + this.newKeyName);
599if (!response.ok) {
600throw new Error('Failed to rename blob');
685});
686687// export default app.fetch;
688export default passwordAuth(app.fetch, {
689// password: "123", // Deno.env.get("AUTH_TEST"),
690});
seiveDubbingmain.tsx2 matches
107},
108};
109const req = await fetch("https://mango.sievedata.com/v2/push", {
110method: "POST",
111body: JSON.stringify(payload),
120121async function pollDubbingJob(jobId) {
122const req = await fetch(`https://mango.sievedata.com/v2/jobs/${jobId}`, {
123headers: {
124"X-API-Key": SIEVE_API_KEY,
6const hnStoryURL = "https://hacker-news.firebaseio.com/v0/item/";
78const topStories = await fetch(hnTopStoriesURL).then((res) => res.json());
9const firstFive = topStories.slice(0, 50);
10const stories = await Promise.all(
11firstFive.map((id: number) => fetch(`${hnStoryURL}${id}.json`).then((res) => res.json())),
12);
13
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 })));
createValVersionmain.tsx2 matches
1// my inserted comment
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
34export function createValVersion({ token, valId, code }: {
26referenceCount: number;
27}> {
28return fetchJSON(
29`https://api.val.town/v1/vals/${valId}/versions`,
30{
pingNationsmain.tsx1 match
16const myHeaders = new Headers(httpHeaders);
17console.log("Starting...");
18let response = await fetch(
19`https://www.nationstates.net/cgi-bin/api.cgi?nation=${nations[i]}&q=issues`,
20{
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";
133});
134135export default modifyFetchHandler(passwordAuth(app.fetch));
nationstatesSentimentAImain.tsx3 matches
1011async function query(data) {
12const response = await fetch(
13"https://api-inference.huggingface.co/models/cardiffnlp/twitter-roberta-base-sentiment-latest",
14{
33const myHeaders = new Headers(httpHeaders);
34console.log("Starting...");
35let response = await fetch(
36`https://www.nationstates.net/cgi-bin/api.cgi?nation=${Deno.env.get("NATION_ID")}&q=issues`,
37{
70await Promise.all(optionPromises);
7172let execute_issue = await fetch(
73`https://www.nationstates.net/cgi-bin/api.cgi?nation=${
74Deno.env.get("NATION_ID")
test_explorermain.tsx1 match
3export { Test } from "https://esm.town/v/pomdtr/test";
45export default router.fetch;
dubLinkMakermain.tsx2 matches
57// If the destination is `list`, return a list of all the existing short links
58if (destination === "list") {
59const req = await fetch(`https://api.dub.co/links?workspaceId=${dubWorkspaceId}`, {
60headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
61});
8485try {
86const resp = await fetch(`https://api.dub.co/links?workspaceId=${dubWorkspaceId}`, options).then(
87response => response.json(),
88);